cardano-ledger-byron-1.0.2.0: The blockchain layer of Cardano during the Byron era
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Chain.Common

Synopsis

Documentation

data TxSizeLinear Source #

A linear equation on the transaction size. Represents the s -> a + b*s function where s is the transaction size in bytes, a and b are constant coefficients.

Instances

Instances details
ToJSON TxSizeLinear Source # 
Instance details

Defined in Cardano.Chain.Common.TxSizeLinear

Generic TxSizeLinear Source # 
Instance details

Defined in Cardano.Chain.Common.TxSizeLinear

Associated Types

type Rep TxSizeLinearTypeType Source #

Show TxSizeLinear Source # 
Instance details

Defined in Cardano.Chain.Common.TxSizeLinear

FromCBOR TxSizeLinear Source # 
Instance details

Defined in Cardano.Chain.Common.TxSizeLinear

ToCBOR TxSizeLinear Source # 
Instance details

Defined in Cardano.Chain.Common.TxSizeLinear

Methods

toCBORTxSizeLinearEncoding Source #

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

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

DecCBOR TxSizeLinear Source # 
Instance details

Defined in Cardano.Chain.Common.TxSizeLinear

EncCBOR TxSizeLinear Source # 
Instance details

Defined in Cardano.Chain.Common.TxSizeLinear

NFData TxSizeLinear Source # 
Instance details

Defined in Cardano.Chain.Common.TxSizeLinear

Methods

rnfTxSizeLinear → () Source #

Buildable TxSizeLinear Source # 
Instance details

Defined in Cardano.Chain.Common.TxSizeLinear

Eq TxSizeLinear Source # 
Instance details

Defined in Cardano.Chain.Common.TxSizeLinear

Ord TxSizeLinear Source # 
Instance details

Defined in Cardano.Chain.Common.TxSizeLinear

NoThunks TxSizeLinear Source # 
Instance details

Defined in Cardano.Chain.Common.TxSizeLinear

type Rep TxSizeLinear Source # 
Instance details

Defined in Cardano.Chain.Common.TxSizeLinear

type Rep TxSizeLinear = D1 ('MetaData "TxSizeLinear" "Cardano.Chain.Common.TxSizeLinear" "cardano-ledger-byron-1.0.2.0-inplace" 'False) (C1 ('MetaCons "TxSizeLinear" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Lovelace) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Rational)))

data TxFeePolicy Source #

Transaction fee policy represents a formula to compute the minimal allowed Fee for a transaction. Transactions with lesser fees won't be accepted. The Minimal fee may depend on the properties of a transaction (for example, its Size in bytes), so the policy can't be represented simply as a number.

Recall that a transaction fee is the difference between the sum of its Inputs and the sum of its outputs. The transaction is accepted when minimal_fee(tx) <= fee(tx), where minimal_fee is the function defined By the policy.

The policy can change during the lifetime of the blockchain (using the Update mechanism). At the moment we have just one policy type (a linear Equation on the transaction size), but in the future other policies may Be added. To make this future-proof, we also have an "unknown" policy used By older node versions (the ones that haven't updated yet).

Instances

Instances details
ToJSON TxFeePolicy Source # 
Instance details

Defined in Cardano.Chain.Common.TxFeePolicy

Generic TxFeePolicy Source # 
Instance details

Defined in Cardano.Chain.Common.TxFeePolicy

Associated Types

type Rep TxFeePolicyTypeType Source #

Show TxFeePolicy Source # 
Instance details

Defined in Cardano.Chain.Common.TxFeePolicy

FromCBOR TxFeePolicy Source # 
Instance details

Defined in Cardano.Chain.Common.TxFeePolicy

ToCBOR TxFeePolicy Source # 
Instance details

Defined in Cardano.Chain.Common.TxFeePolicy

Methods

toCBORTxFeePolicyEncoding Source #

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

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

DecCBOR TxFeePolicy Source # 
Instance details

Defined in Cardano.Chain.Common.TxFeePolicy

EncCBOR TxFeePolicy Source # 
Instance details

Defined in Cardano.Chain.Common.TxFeePolicy

Methods

encCBORTxFeePolicyEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy TxFeePolicySize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [TxFeePolicy] → Size Source #

NFData TxFeePolicy Source # 
Instance details

Defined in Cardano.Chain.Common.TxFeePolicy

Methods

rnfTxFeePolicy → () Source #

Buildable TxFeePolicy Source # 
Instance details

Defined in Cardano.Chain.Common.TxFeePolicy

Eq TxFeePolicy Source # 
Instance details

Defined in Cardano.Chain.Common.TxFeePolicy

Ord TxFeePolicy Source # 
Instance details

Defined in Cardano.Chain.Common.TxFeePolicy

NoThunks TxFeePolicy Source # 
Instance details

Defined in Cardano.Chain.Common.TxFeePolicy

MonadError SchemaError m ⇒ FromJSON m TxFeePolicy Source # 
Instance details

Defined in Cardano.Chain.Common.TxFeePolicy

Monad m ⇒ ToJSON m TxFeePolicy Source # 
Instance details

Defined in Cardano.Chain.Common.TxFeePolicy

Methods

toJSONTxFeePolicy → m JSValue Source #

type Rep TxFeePolicy Source # 
Instance details

Defined in Cardano.Chain.Common.TxFeePolicy

type Rep TxFeePolicy = D1 ('MetaData "TxFeePolicy" "Cardano.Chain.Common.TxFeePolicy" "cardano-ledger-byron-1.0.2.0-inplace" 'False) (C1 ('MetaCons "TxFeePolicyTxSizeLinear" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TxSizeLinear)))

data NetworkMagic Source #

Instances

Instances details
ToJSON NetworkMagic Source # 
Instance details

Defined in Cardano.Chain.Common.NetworkMagic

Generic NetworkMagic Source # 
Instance details

Defined in Cardano.Chain.Common.NetworkMagic

Associated Types

type Rep NetworkMagicTypeType Source #

Show NetworkMagic Source # 
Instance details

Defined in Cardano.Chain.Common.NetworkMagic

FromCBOR NetworkMagic Source # 
Instance details

Defined in Cardano.Chain.Common.NetworkMagic

ToCBOR NetworkMagic Source # 
Instance details

Defined in Cardano.Chain.Common.NetworkMagic

Methods

toCBORNetworkMagicEncoding Source #

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

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

DecCBOR NetworkMagic Source # 
Instance details

Defined in Cardano.Chain.Common.NetworkMagic

EncCBOR NetworkMagic Source # 
Instance details

Defined in Cardano.Chain.Common.NetworkMagic

NFData NetworkMagic Source # 
Instance details

Defined in Cardano.Chain.Common.NetworkMagic

Methods

rnfNetworkMagic → () Source #

Buildable NetworkMagic Source # 
Instance details

Defined in Cardano.Chain.Common.NetworkMagic

Eq NetworkMagic Source # 
Instance details

Defined in Cardano.Chain.Common.NetworkMagic

Ord NetworkMagic Source # 
Instance details

Defined in Cardano.Chain.Common.NetworkMagic

HeapWords NetworkMagic Source # 
Instance details

Defined in Cardano.Chain.Common.NetworkMagic

NoThunks NetworkMagic Source # 
Instance details

Defined in Cardano.Chain.Common.NetworkMagic

type Rep NetworkMagic Source # 
Instance details

Defined in Cardano.Chain.Common.NetworkMagic

type Rep NetworkMagic = D1 ('MetaData "NetworkMagic" "Cardano.Chain.Common.NetworkMagic" "cardano-ledger-byron-1.0.2.0-inplace" 'False) (C1 ('MetaCons "NetworkMainOrStage" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "NetworkTestnet" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32)))

MerkleRoot

newtype MerkleRoot a Source #

Data type for root of Merkle tree

Constructors

MerkleRoot 

Fields

Instances

Instances details
ToJSON a ⇒ ToJSON (MerkleRoot a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

Generic (MerkleRoot a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

Associated Types

type Rep (MerkleRoot a) ∷ TypeType Source #

Methods

fromMerkleRoot a → Rep (MerkleRoot a) x Source #

toRep (MerkleRoot a) x → MerkleRoot a Source #

Show (MerkleRoot a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

DecCBOR a ⇒ FromCBOR (MerkleRoot a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

EncCBOR a ⇒ ToCBOR (MerkleRoot a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

Methods

toCBORMerkleRoot a → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (MerkleRoot a) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [MerkleRoot a] → Size Source #

DecCBOR a ⇒ DecCBOR (MerkleRoot a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

EncCBOR a ⇒ EncCBOR (MerkleRoot a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

Methods

encCBORMerkleRoot a → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (MerkleRoot a) → Size Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [MerkleRoot a] → Size Source #

NFData (MerkleRoot a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

Methods

rnfMerkleRoot a → () Source #

Buildable (MerkleRoot a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

Methods

buildMerkleRoot a → Builder Source #

Eq (MerkleRoot a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

Methods

(==)MerkleRoot a → MerkleRoot a → Bool Source #

(/=)MerkleRoot a → MerkleRoot a → Bool Source #

Ord (MerkleRoot a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

NoThunks (MerkleRoot a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

type Rep (MerkleRoot a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

type Rep (MerkleRoot a) = D1 ('MetaData "MerkleRoot" "Cardano.Chain.Common.Merkle" "cardano-ledger-byron-1.0.2.0-inplace" 'True) (C1 ('MetaCons "MerkleRoot" 'PrefixI 'True) (S1 ('MetaSel ('Just "getMerkleRoot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Hash Raw))))

MerkleTree

data MerkleTree a Source #

Instances

Instances details
Foldable MerkleTree Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

Methods

foldMonoid m ⇒ MerkleTree m → m Source #

foldMapMonoid m ⇒ (a → m) → MerkleTree a → m Source #

foldMap'Monoid m ⇒ (a → m) → MerkleTree a → m Source #

foldr ∷ (a → b → b) → b → MerkleTree a → b Source #

foldr' ∷ (a → b → b) → b → MerkleTree a → b Source #

foldl ∷ (b → a → b) → b → MerkleTree a → b Source #

foldl' ∷ (b → a → b) → b → MerkleTree a → b Source #

foldr1 ∷ (a → a → a) → MerkleTree a → a Source #

foldl1 ∷ (a → a → a) → MerkleTree a → a Source #

toListMerkleTree a → [a] Source #

nullMerkleTree a → Bool Source #

lengthMerkleTree a → Int Source #

elemEq a ⇒ a → MerkleTree a → Bool Source #

maximumOrd a ⇒ MerkleTree a → a Source #

minimumOrd a ⇒ MerkleTree a → a Source #

sumNum a ⇒ MerkleTree a → a Source #

productNum a ⇒ MerkleTree a → a Source #

Generic (MerkleTree a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

Associated Types

type Rep (MerkleTree a) ∷ TypeType Source #

Methods

fromMerkleTree a → Rep (MerkleTree a) x Source #

toRep (MerkleTree a) x → MerkleTree a Source #

Show a ⇒ Show (MerkleTree a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

(DecCBOR a, EncCBOR a) ⇒ FromCBOR (MerkleTree a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

EncCBOR a ⇒ ToCBOR (MerkleTree a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

Methods

toCBORMerkleTree a → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (MerkleTree a) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [MerkleTree a] → Size Source #

(DecCBOR a, EncCBOR a) ⇒ DecCBOR (MerkleTree a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

EncCBOR a ⇒ EncCBOR (MerkleTree a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

Methods

encCBORMerkleTree a → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (MerkleTree a) → Size Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [MerkleTree a] → Size Source #

NFData a ⇒ NFData (MerkleTree a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

Methods

rnfMerkleTree a → () Source #

Eq a ⇒ Eq (MerkleTree a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

Methods

(==)MerkleTree a → MerkleTree a → Bool Source #

(/=)MerkleTree a → MerkleTree a → Bool Source #

type Rep (MerkleTree a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

type Rep (MerkleTree a) = D1 ('MetaData "MerkleTree" "Cardano.Chain.Common.Merkle" "cardano-ledger-byron-1.0.2.0-inplace" 'False) (C1 ('MetaCons "MerkleEmpty" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "MerkleTree" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (MerkleNode a))))

mtRootMerkleTree a → MerkleRoot a Source #

Returns root of Merkle tree

mkMerkleTreeEncCBOR a ⇒ [a] → MerkleTree a Source #

Smart constructor for MerkleTree

mkMerkleTreeDecoded ∷ [Annotated a ByteString] → MerkleTree a Source #

Reconstruct a MerkleTree from a decoded list of items

MerkleNode

data MerkleNode a Source #

Constructors

MerkleBranch !(MerkleRoot a) !(MerkleNode a) !(MerkleNode a)

MerkleBranch mRoot mLeft mRight

MerkleLeaf !(MerkleRoot a) a

MerkleLeaf mRoot mVal

Instances

Instances details
Foldable MerkleNode Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

Methods

foldMonoid m ⇒ MerkleNode m → m Source #

foldMapMonoid m ⇒ (a → m) → MerkleNode a → m Source #

foldMap'Monoid m ⇒ (a → m) → MerkleNode a → m Source #

foldr ∷ (a → b → b) → b → MerkleNode a → b Source #

foldr' ∷ (a → b → b) → b → MerkleNode a → b Source #

foldl ∷ (b → a → b) → b → MerkleNode a → b Source #

foldl' ∷ (b → a → b) → b → MerkleNode a → b Source #

foldr1 ∷ (a → a → a) → MerkleNode a → a Source #

foldl1 ∷ (a → a → a) → MerkleNode a → a Source #

toListMerkleNode a → [a] Source #

nullMerkleNode a → Bool Source #

lengthMerkleNode a → Int Source #

elemEq a ⇒ a → MerkleNode a → Bool Source #

maximumOrd a ⇒ MerkleNode a → a Source #

minimumOrd a ⇒ MerkleNode a → a Source #

sumNum a ⇒ MerkleNode a → a Source #

productNum a ⇒ MerkleNode a → a Source #

Generic (MerkleNode a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

Associated Types

type Rep (MerkleNode a) ∷ TypeType Source #

Methods

fromMerkleNode a → Rep (MerkleNode a) x Source #

toRep (MerkleNode a) x → MerkleNode a Source #

Show a ⇒ Show (MerkleNode a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

NFData a ⇒ NFData (MerkleNode a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

Methods

rnfMerkleNode a → () Source #

Eq a ⇒ Eq (MerkleNode a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

Methods

(==)MerkleNode a → MerkleNode a → Bool Source #

(/=)MerkleNode a → MerkleNode a → Bool Source #

type Rep (MerkleNode a) Source # 
Instance details

Defined in Cardano.Chain.Common.Merkle

mkLeaf ∷ ∀ a. EncCBOR a ⇒ a → MerkleNode a Source #

data LovelacePortion Source #

LovelacePortion is a legacy Byron type that we keep only for compatibility. It was originally intended to represent a fraction of stake in the system. It is used only for the thresholds used in the update system rules, most of which are now themselves unused. The remaining case is no longer interpreted as a fraction of all stake, but as a fraction of the number of genesis keys.

It has enormous precision, due to the fact that it was originally intended to represent a fraction of all stake and can cover the precision of all the Lovelace in the system.

It is represented as a rational nominator with a fixed implicit denominator of 1e15. So the nominator must be in the range [0..1e15]. This is also the representation used on-chain (in update proposals) and in the JSON genesis file.

It is interpreted as a Rational via the provided conversion functions.

Instances

Instances details
ToJSON LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

Generic LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

Associated Types

type Rep LovelacePortionTypeType Source #

Show LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

FromCBOR LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

ToCBOR LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

DecCBOR LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

EncCBOR LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

NFData LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

Methods

rnfLovelacePortion → () Source #

Buildable LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

Eq LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

Ord LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

HeapWords LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

NoThunks LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

MonadError SchemaError m ⇒ FromJSON m LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

Monad m ⇒ ToJSON m LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

type Rep LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

type Rep LovelacePortion = D1 ('MetaData "LovelacePortion" "Cardano.Chain.Common.LovelacePortion" "cardano-ledger-byron-1.0.2.0-inplace" 'True) (C1 ('MetaCons "LovelacePortion" 'PrefixI 'True) (S1 ('MetaSel ('Just "unLovelacePortion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

rationalToLovelacePortionRationalLovelacePortion Source #

Make a LovelacePortion from a Rational which must be in the range [0..1].

Lovelace

data Lovelace Source #

Lovelace is the least possible unit of currency

Instances

Instances details
ToJSON Lovelace Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

Data Lovelace Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

Methods

gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → Lovelace → c Lovelace Source #

gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c Lovelace Source #

toConstrLovelaceConstr Source #

dataTypeOfLovelaceDataType Source #

dataCast1Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c Lovelace) Source #

dataCast2Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c Lovelace) Source #

gmapT ∷ (∀ b. Data b ⇒ b → b) → LovelaceLovelace Source #

gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → Lovelace → r Source #

gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → Lovelace → r Source #

gmapQ ∷ (∀ d. Data d ⇒ d → u) → Lovelace → [u] Source #

gmapQiInt → (∀ d. Data d ⇒ d → u) → Lovelace → u Source #

gmapMMonad m ⇒ (∀ d. Data d ⇒ d → m d) → Lovelace → m Lovelace Source #

gmapMpMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → Lovelace → m Lovelace Source #

gmapMoMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → Lovelace → m Lovelace Source #

Bounded Lovelace Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

Generic Lovelace Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

Associated Types

type Rep LovelaceTypeType Source #

Show Lovelace Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

FromCBOR Lovelace Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

ToCBOR Lovelace Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

Methods

toCBORLovelaceEncoding Source #

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

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

DecCBOR Lovelace Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

EncCBOR Lovelace Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

Methods

encCBORLovelaceEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy LovelaceSize Source #

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

NFData Lovelace Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

Methods

rnfLovelace → () Source #

Buildable Lovelace Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

Methods

buildLovelaceBuilder Source #

Eq Lovelace Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

Ord Lovelace Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

NoThunks Lovelace Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

ReportSchemaErrors m ⇒ FromJSON m Lovelace Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

Methods

fromJSONJSValue → m Lovelace Source #

Monad m ⇒ ToJSON m Lovelace Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

Methods

toJSONLovelace → m JSValue Source #

type Rep Lovelace Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

type Rep Lovelace = D1 ('MetaData "Lovelace" "Cardano.Chain.Common.Lovelace" "cardano-ledger-byron-1.0.2.0-inplace" 'True) (C1 ('MetaCons "Lovelace" 'PrefixI 'True) (S1 ('MetaSel ('Just "unLovelace") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

data LovelaceError Source #

Instances

Instances details
Data LovelaceError Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

Methods

gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → LovelaceError → c LovelaceError Source #

gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c LovelaceError Source #

toConstrLovelaceErrorConstr Source #

dataTypeOfLovelaceErrorDataType Source #

dataCast1Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c LovelaceError) Source #

dataCast2Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c LovelaceError) Source #

gmapT ∷ (∀ b. Data b ⇒ b → b) → LovelaceErrorLovelaceError Source #

gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → LovelaceError → r Source #

gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → LovelaceError → r Source #

gmapQ ∷ (∀ d. Data d ⇒ d → u) → LovelaceError → [u] Source #

gmapQiInt → (∀ d. Data d ⇒ d → u) → LovelaceError → u Source #

gmapMMonad m ⇒ (∀ d. Data d ⇒ d → m d) → LovelaceError → m LovelaceError Source #

gmapMpMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → LovelaceError → m LovelaceError Source #

gmapMoMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → LovelaceError → m LovelaceError Source #

Show LovelaceError Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

FromCBOR LovelaceError Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

ToCBOR LovelaceError Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

DecCBOR LovelaceError Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

EncCBOR LovelaceError Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

Buildable LovelaceError Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

Eq LovelaceError Source # 
Instance details

Defined in Cardano.Chain.Common.Lovelace

maxLovelaceValWord64 Source #

Maximal possible value of Lovelace

Constructors

mkLovelaceWord64Either LovelaceError Lovelace Source #

Constructor for Lovelace returning LovelaceError when c exceeds maxLovelaceVal

mkKnownLovelace ∷ ∀ n. (KnownNat n, n <= 45000000000000000) ⇒ Lovelace Source #

Construct a Lovelace from a KnownNat, known to be less than maxLovelaceVal

Formatting

lovelaceFFormat r (Lovelace → r) Source #

Lovelace formatter which restricts type.

Conversions

unsafeGetLovelaceLovelaceWord64 Source #

Unwraps Lovelace. It's called “unsafe” so that people wouldn't use it willy-nilly if they want to sum lovelace or something. It's actually safe.

Arithmetic operations

sumLovelace ∷ (Foldable t, Functor t) ⇒ t LovelaceEither LovelaceError Lovelace Source #

Compute sum of all lovelace in container. Result is Integer as a protection against possible overflow.

addLovelaceLovelaceLovelaceEither LovelaceError Lovelace Source #

Addition of lovelace, returning LovelaceError in case of overflow

subLovelaceLovelaceLovelaceEither LovelaceError Lovelace Source #

Subtraction of lovelace, returning LovelaceError on underflow

scaleLovelaceIntegral b ⇒ Lovelace → b → Either LovelaceError Lovelace Source #

Scale a Lovelace by an Integral factor, returning LovelaceError when the result is too large

scaleLovelaceRationalLovelaceRationalLovelace Source #

Scale a Lovelace by a rational factor, rounding down.

scaleLovelaceRationalUpLovelaceRationalLovelace Source #

Scale a Lovelace by a rational factor, rounding up.

divLovelaceIntegral b ⇒ Lovelace → b → Either LovelaceError Lovelace Source #

Integer division of a Lovelace by an Integral factor

modLovelaceIntegral b ⇒ Lovelace → b → Either LovelaceError Lovelace Source #

Integer modulus of a Lovelace by an Integral factor

newtype KeyHash Source #

A KeyHash refers to a VerificationKey

Constructors

KeyHash 

Instances

Instances details
Show KeyHash Source # 
Instance details

Defined in Cardano.Chain.Common.KeyHash

DecCBOR KeyHash Source # 
Instance details

Defined in Cardano.Chain.Common.KeyHash

EncCBOR KeyHash Source # 
Instance details

Defined in Cardano.Chain.Common.KeyHash

Methods

encCBORKeyHashEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy KeyHashSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [KeyHash] → Size Source #

NFData KeyHash Source # 
Instance details

Defined in Cardano.Chain.Common.KeyHash

Methods

rnfKeyHash → () Source #

Buildable KeyHash Source # 
Instance details

Defined in Cardano.Chain.Common.KeyHash

Methods

buildKeyHashBuilder Source #

Eq KeyHash Source # 
Instance details

Defined in Cardano.Chain.Common.KeyHash

Methods

(==)KeyHashKeyHashBool Source #

(/=)KeyHashKeyHashBool Source #

Ord KeyHash Source # 
Instance details

Defined in Cardano.Chain.Common.KeyHash

HeapWords KeyHash Source # 
Instance details

Defined in Cardano.Chain.Common.KeyHash

Methods

heapWordsKeyHashInt Source #

NoThunks KeyHash Source # 
Instance details

Defined in Cardano.Chain.Common.KeyHash

MonadError SchemaError m ⇒ FromObjectKey m KeyHash Source # 
Instance details

Defined in Cardano.Chain.Common.KeyHash

Monad m ⇒ ToObjectKey m KeyHash Source # 
Instance details

Defined in Cardano.Chain.Common.KeyHash

data CompactAddress Source #

A compact in-memory representation for an Address.

Convert using toCompactAddress and fromCompactAddress.

Instances

Instances details
Generic CompactAddress Source # 
Instance details

Defined in Cardano.Chain.Common.Compact

Associated Types

type Rep CompactAddressTypeType Source #

Show CompactAddress Source # 
Instance details

Defined in Cardano.Chain.Common.Compact

FromCBOR CompactAddress Source # 
Instance details

Defined in Cardano.Chain.Common.Compact

ToCBOR CompactAddress Source # 
Instance details

Defined in Cardano.Chain.Common.Compact

DecCBOR CompactAddress Source # 
Instance details

Defined in Cardano.Chain.Common.Compact

EncCBOR CompactAddress Source # 
Instance details

Defined in Cardano.Chain.Common.Compact

NFData CompactAddress Source # 
Instance details

Defined in Cardano.Chain.Common.Compact

Methods

rnfCompactAddress → () Source #

Eq CompactAddress Source # 
Instance details

Defined in Cardano.Chain.Common.Compact

Ord CompactAddress Source # 
Instance details

Defined in Cardano.Chain.Common.Compact

HeapWords CompactAddress Source # 
Instance details

Defined in Cardano.Chain.Common.Compact

NoThunks CompactAddress Source # 
Instance details

Defined in Cardano.Chain.Common.Compact

type Rep CompactAddress Source # 
Instance details

Defined in Cardano.Chain.Common.Compact

type Rep CompactAddress = D1 ('MetaData "CompactAddress" "Cardano.Chain.Common.Compact" "cardano-ledger-byron-1.0.2.0-inplace" 'True) (C1 ('MetaCons "CompactAddress" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortByteString)))

newtype ChainDifficulty Source #

Chain difficulty represents necessary effort to generate a chain. In the simplest case it can be number of blocks in chain.

Constructors

ChainDifficulty 

Instances

Instances details
ToJSON ChainDifficulty Source # 
Instance details

Defined in Cardano.Chain.Common.ChainDifficulty

Enum ChainDifficulty Source # 
Instance details

Defined in Cardano.Chain.Common.ChainDifficulty

Generic ChainDifficulty Source # 
Instance details

Defined in Cardano.Chain.Common.ChainDifficulty

Associated Types

type Rep ChainDifficultyTypeType Source #

Show ChainDifficulty Source # 
Instance details

Defined in Cardano.Chain.Common.ChainDifficulty

FromCBOR ChainDifficulty Source # 
Instance details

Defined in Cardano.Chain.Common.ChainDifficulty

ToCBOR ChainDifficulty Source # 
Instance details

Defined in Cardano.Chain.Common.ChainDifficulty

DecCBOR ChainDifficulty Source # 
Instance details

Defined in Cardano.Chain.Common.ChainDifficulty

EncCBOR ChainDifficulty Source # 
Instance details

Defined in Cardano.Chain.Common.ChainDifficulty

NFData ChainDifficulty Source # 
Instance details

Defined in Cardano.Chain.Common.ChainDifficulty

Methods

rnfChainDifficulty → () Source #

Buildable ChainDifficulty Source # 
Instance details

Defined in Cardano.Chain.Common.ChainDifficulty

Eq ChainDifficulty Source # 
Instance details

Defined in Cardano.Chain.Common.ChainDifficulty

Ord ChainDifficulty Source # 
Instance details

Defined in Cardano.Chain.Common.ChainDifficulty

NoThunks ChainDifficulty Source # 
Instance details

Defined in Cardano.Chain.Common.ChainDifficulty

type Rep ChainDifficulty Source # 
Instance details

Defined in Cardano.Chain.Common.ChainDifficulty

type Rep ChainDifficulty = D1 ('MetaData "ChainDifficulty" "Cardano.Chain.Common.ChainDifficulty" "cardano-ledger-byron-1.0.2.0-inplace" 'True) (C1 ('MetaCons "ChainDifficulty" 'PrefixI 'True) (S1 ('MetaSel ('Just "unChainDifficulty") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

CBOR in CBOR

These utilities are is used in the Byron-era chain encodings in cases where there are extensible parts of the encoding. In thse cases we have to be able to handle unknown extensions and thus decode values where we do not know the concrete type.

To solve this, the serialised representation uses nested CBOR-in-CBOR https://tools.ietf.org/html/rfc7049#section-2.4.4.1. The nesting means that the size is known without having to decode the body in those cases where we cannot decode the body.

The functions in this module handle the encoding and decoding for the cases of the known and unknown types.

encodeKnownCborDataItemEncCBOR a ⇒ a → Encoding Source #

This is an alias for encodeNestedCbor.

This function is used to handle the case of a known type, but compatible with the encoding used by encodeUnknownCborDataItem.

encodeUnknownCborDataItemLByteStringEncoding Source #

This is an alias for encodeNestedCborBytes, so all its details apply.

This function is used to handle the case of an unknown type, so it takes an opaque blob that is the representation of the value of the unknown type.

decodeKnownCborDataItemDecCBOR a ⇒ Decoder s a Source #

This is an alias for decodeNestedCbor.

This function is used to handle the case of a known type, but compatible with the encoding used by decodeUnknownCborDataItem.

decodeUnknownCborDataItemDecoder s ByteString Source #

This is an alias for decodeNestedCborBytes, so all its details apply.

This function is used to handle the case of an unknown type, so it returns an opaque blob that is the representation of the value of the unknown type.

Cyclic redundancy check

The Byron era address format includes a CRC to help resist accidental corruption. These functions deal with encoding and decoding the format that is used.

encodeCrcProtectedEncCBOR a ⇒ a → Encoding Source #

Encodes a value of type a, protecting it from accidental corruption by protecting it with a CRC.

encodedCrcProtectedSizeExpr ∷ ∀ a. EncCBOR a ⇒ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy a → Size Source #

decodeCrcProtected ∷ ∀ s a. DecCBOR a ⇒ Decoder s a Source #

Decodes a CBOR blob into a value of type a, checking the serialised CRC corresponds to the computed one

newtype BlockCount Source #

Constructors

BlockCount 

Fields

Instances

Instances details
Enum BlockCount Source # 
Instance details

Defined in Cardano.Chain.Common.BlockCount

Generic BlockCount Source # 
Instance details

Defined in Cardano.Chain.Common.BlockCount

Associated Types

type Rep BlockCountTypeType Source #

Read BlockCount Source # 
Instance details

Defined in Cardano.Chain.Common.BlockCount

Show BlockCount Source # 
Instance details

Defined in Cardano.Chain.Common.BlockCount

FromCBOR BlockCount Source # 
Instance details

Defined in Cardano.Chain.Common.BlockCount

ToCBOR BlockCount Source # 
Instance details

Defined in Cardano.Chain.Common.BlockCount

Methods

toCBORBlockCountEncoding Source #

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

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

DecCBOR BlockCount Source # 
Instance details

Defined in Cardano.Chain.Common.BlockCount

EncCBOR BlockCount Source # 
Instance details

Defined in Cardano.Chain.Common.BlockCount

Methods

encCBORBlockCountEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy BlockCountSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [BlockCount] → Size Source #

NFData BlockCount Source # 
Instance details

Defined in Cardano.Chain.Common.BlockCount

Methods

rnfBlockCount → () Source #

Buildable BlockCount Source # 
Instance details

Defined in Cardano.Chain.Common.BlockCount

Eq BlockCount Source # 
Instance details

Defined in Cardano.Chain.Common.BlockCount

Ord BlockCount Source # 
Instance details

Defined in Cardano.Chain.Common.BlockCount

NoThunks BlockCount Source # 
Instance details

Defined in Cardano.Chain.Common.BlockCount

type Rep BlockCount Source # 
Instance details

Defined in Cardano.Chain.Common.BlockCount

type Rep BlockCount = D1 ('MetaData "BlockCount" "Cardano.Chain.Common.BlockCount" "cardano-ledger-byron-1.0.2.0-inplace" 'True) (C1 ('MetaCons "BlockCount" 'PrefixI 'True) (S1 ('MetaSel ('Just "unBlockCount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

newtype UnparsedFields Source #

Representation of unparsed fields in Attributes. Newtype wrapper is used for clear backward compatibility between previous representation (which was just a single ByteString) during transition from Store to CBOR.

Instances

Instances details
ToJSON UnparsedFields Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

Generic UnparsedFields Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

Associated Types

type Rep UnparsedFieldsTypeType Source #

Show UnparsedFields Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

NFData UnparsedFields Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

Methods

rnfUnparsedFields → () Source #

Eq UnparsedFields Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

Ord UnparsedFields Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

HeapWords UnparsedFields Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

NoThunks UnparsedFields Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

type Rep UnparsedFields Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

type Rep UnparsedFields = D1 ('MetaData "UnparsedFields" "Cardano.Chain.Common.Attributes" "cardano-ledger-byron-1.0.2.0-inplace" 'True) (C1 ('MetaCons "UnparsedFields" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Word8 ByteString))))

data Attributes h Source #

Convenient wrapper for the datatype to represent it (in binary format) as k-v map

Constructors

Attributes 

Fields

Instances

Instances details
ToJSON a ⇒ ToJSON (Attributes a) Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

Generic (Attributes h) Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

Associated Types

type Rep (Attributes h) ∷ TypeType Source #

Methods

fromAttributes h → Rep (Attributes h) x Source #

toRep (Attributes h) x → Attributes h Source #

Show h ⇒ Show (Attributes h) Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

FromCBOR (Attributes AddrAttributes) Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

FromCBOR (Attributes ()) Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

ToCBOR (Attributes AddrAttributes) Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

ToCBOR (Attributes ()) Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

Methods

toCBORAttributes () → Encoding Source #

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

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

DecCBOR (Attributes AddrAttributes) Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

DecCBOR (Attributes ()) Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

EncCBOR (Attributes AddrAttributes) Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

EncCBOR (Attributes ()) Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

Methods

encCBORAttributes () → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (Attributes ()) → Size Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [Attributes ()] → Size Source #

NFData h ⇒ NFData (Attributes h) Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

Methods

rnfAttributes h → () Source #

Buildable (Attributes ()) Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

Methods

buildAttributes () → Builder Source #

Buildable h ⇒ Buildable (Attributes h) Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

Methods

buildAttributes h → Builder Source #

Eq h ⇒ Eq (Attributes h) Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

Methods

(==)Attributes h → Attributes h → Bool Source #

(/=)Attributes h → Attributes h → Bool Source #

Ord h ⇒ Ord (Attributes h) Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

HeapWords h ⇒ HeapWords (Attributes h) Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

Methods

heapWordsAttributes h → Int Source #

NoThunks h ⇒ NoThunks (Attributes h) Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

type Rep (Attributes h) Source # 
Instance details

Defined in Cardano.Chain.Common.Attributes

type Rep (Attributes h) = D1 ('MetaData "Attributes" "Cardano.Chain.Common.Attributes" "cardano-ledger-byron-1.0.2.0-inplace" 'False) (C1 ('MetaCons "Attributes" 'PrefixI 'True) (S1 ('MetaSel ('Just "attrData") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 h) :*: S1 ('MetaSel ('Just "attrRemain") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 UnparsedFields)))

attributesAreKnownAttributes a → Bool Source #

Check whether all data from Attributes is known, i. e. was successfully parsed into some structured data

encCBORAttributes ∷ ∀ t. [(Word8, t → ByteString)] → Attributes t → Encoding Source #

decCBORAttributes ∷ ∀ t s. t → (Word8ByteString → t → Decoder s (Maybe t)) → Decoder s (Attributes t) Source #

dropEmptyAttributesDropper s Source #

Drop `Attributes ()` making sure that the UnparsedFields are empty

type AddressHash = AbstractHash Blake2b_224 Source #

Hash used to identify address.

data Address Source #

Address is where you can send Lovelace

Constructors

Address 

Fields

Instances

Instances details
ToJSON Address Source # 
Instance details

Defined in Cardano.Chain.Common.Address

Generic Address Source # 
Instance details

Defined in Cardano.Chain.Common.Address

Associated Types

type Rep AddressTypeType Source #

Methods

fromAddressRep Address x Source #

toRep Address x → Address Source #

Show Address Source # 
Instance details

Defined in Cardano.Chain.Common.Address

FromCBOR Address Source # 
Instance details

Defined in Cardano.Chain.Common.Address

ToCBOR Address Source # 
Instance details

Defined in Cardano.Chain.Common.Address

Methods

toCBORAddressEncoding Source #

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

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

DecCBOR Address Source # 
Instance details

Defined in Cardano.Chain.Common.Address

EncCBOR Address Source # 
Instance details

Defined in Cardano.Chain.Common.Address

Methods

encCBORAddressEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy AddressSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [Address] → Size Source #

NFData Address Source # 
Instance details

Defined in Cardano.Chain.Common.Address

Methods

rnfAddress → () Source #

Buildable Address Source # 
Instance details

Defined in Cardano.Chain.Common.Address

Methods

buildAddressBuilder Source #

Eq Address Source # 
Instance details

Defined in Cardano.Chain.Common.Address

Methods

(==)AddressAddressBool Source #

(/=)AddressAddressBool Source #

Ord Address Source # 
Instance details

Defined in Cardano.Chain.Common.Address

HeapWords Address Source # 
Instance details

Defined in Cardano.Chain.Common.Address

Methods

heapWordsAddressInt Source #

NoThunks Address Source # 
Instance details

Defined in Cardano.Chain.Common.Address

MonadError SchemaError m ⇒ FromJSON m Address Source # 
Instance details

Defined in Cardano.Chain.Common.Address

Methods

fromJSONJSValue → m Address Source #

MonadError SchemaError m ⇒ FromObjectKey m Address Source # 
Instance details

Defined in Cardano.Chain.Common.Address

Monad m ⇒ ToJSON m Address Source # 
Instance details

Defined in Cardano.Chain.Common.Address

Methods

toJSONAddress → m JSValue Source #

Monad m ⇒ ToObjectKey m Address Source # 
Instance details

Defined in Cardano.Chain.Common.Address

Buildable [Address] Source # 
Instance details

Defined in Cardano.Chain.Common.Address

Methods

build ∷ [Address] → Builder Source #

type Rep Address Source # 
Instance details

Defined in Cardano.Chain.Common.Address

type Rep Address = D1 ('MetaData "Address" "Cardano.Chain.Common.Address" "cardano-ledger-byron-1.0.2.0-inplace" 'False) (C1 ('MetaCons "Address" 'PrefixI 'True) (S1 ('MetaSel ('Just "addrRoot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (AddressHash Address')) :*: (S1 ('MetaSel ('Just "addrAttributes") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Attributes AddrAttributes)) :*: S1 ('MetaSel ('Just "addrType") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AddrType))))

newtype Address' Source #

Hash of this data is stored in Address. This type exists mostly for internal usage.

Instances

Instances details
Generic Address' Source # 
Instance details

Defined in Cardano.Chain.Common.Address

Associated Types

type Rep Address'TypeType Source #

Show Address' Source # 
Instance details

Defined in Cardano.Chain.Common.Address

FromCBOR Address' Source # 
Instance details

Defined in Cardano.Chain.Common.Address

ToCBOR Address' Source # 
Instance details

Defined in Cardano.Chain.Common.Address

Methods

toCBORAddress'Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy Address'Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Address'] → Size Source #

DecCBOR Address' Source # 
Instance details

Defined in Cardano.Chain.Common.Address

EncCBOR Address' Source # 
Instance details

Defined in Cardano.Chain.Common.Address

Methods

encCBORAddress'Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy Address'Size Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [Address'] → Size Source #

Eq Address' Source # 
Instance details

Defined in Cardano.Chain.Common.Address

type Rep Address' Source # 
Instance details

Defined in Cardano.Chain.Common.Address

type Rep Address' = D1 ('MetaData "Address'" "Cardano.Chain.Common.Address" "cardano-ledger-byron-1.0.2.0-inplace" 'True) (C1 ('MetaCons "Address'" 'PrefixI 'True) (S1 ('MetaSel ('Just "unAddress'") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (AddrType, AddrSpendingData, Attributes AddrAttributes))))

Formatting

addressFFormat r (Address → r) Source #

Specialized formatter for Address

addressDetailedFFormat r (Address → r) Source #

A formatter showing guts of an Address

decCBORTextAddressTextEither DecoderError Address Source #

Deprecated: Use decodeAddressBase58 instead

A function which decodes base58-encoded Address

Spending data checks

checkAddrSpendingDataAddrSpendingDataAddressBool Source #

Check whether given AddrSpendingData corresponds to given Address

checkVerKeyAddressVerificationKeyAddressBool Source #

Check if given Address is created from given VerificationKey

Encoding/Decoding

decodeAddressBase58TextEither DecoderError Address Source #

Decode an address from Base58 encoded Text.

encodeAddressBase58AddressText Source #

Encode an address to Text. `decodeAddressBase58 (encodeAddressBase58 x) === Right x`

Utilities

Pattern-matching helpers

isRedeemAddressAddressBool Source #

Check whether an Address is redeem address

Construction

makeAddressAddrSpendingDataAddrAttributesAddress Source #

Make an Address from spending data and attributes.

makeVerKeyAddressNetworkMagicVerificationKeyAddress Source #

A function for making an address from VerificationKey

makeVerKeyHdwAddress Source #

Arguments

NetworkMagic 
HDAddressPayload

Derivation path

VerificationKey 
Address 

A function for making an HDW address

data AddrSpendingData Source #

Data which is bound to an address and must be revealed in order to spend lovelace belonging to this address.

Constructors

VerKeyASD !VerificationKey

Funds can be spent by revealing a VerificationKey and providing a valid signature

RedeemASD !RedeemVerificationKey

Funds can be spent by revealing a RedeemVerificationKey and providing a valid signature

Instances

Instances details
Generic AddrSpendingData Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

Associated Types

type Rep AddrSpendingDataTypeType Source #

Show AddrSpendingData Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

FromCBOR AddrSpendingData Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

ToCBOR AddrSpendingData Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

DecCBOR AddrSpendingData Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

EncCBOR AddrSpendingData Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

NFData AddrSpendingData Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

Methods

rnfAddrSpendingData → () Source #

Buildable AddrSpendingData Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

Eq AddrSpendingData Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

type Rep AddrSpendingData Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

type Rep AddrSpendingData = D1 ('MetaData "AddrSpendingData" "Cardano.Chain.Common.AddrSpendingData" "cardano-ledger-byron-1.0.2.0-inplace" 'False) (C1 ('MetaCons "VerKeyASD" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 VerificationKey)) :+: C1 ('MetaCons "RedeemASD" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RedeemVerificationKey)))

data AddrType Source #

Type of an address. It corresponds to constructors of AddrSpendingData. It's separated, because Address doesn't store AddrSpendingData, but we want to know its type.

Constructors

ATVerKey 
ATRedeem 

Instances

Instances details
ToJSON AddrType Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

Generic AddrType Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

Associated Types

type Rep AddrTypeTypeType Source #

Show AddrType Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

FromCBOR AddrType Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

ToCBOR AddrType Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

Methods

toCBORAddrTypeEncoding Source #

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

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

DecCBOR AddrType Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

EncCBOR AddrType Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

Methods

encCBORAddrTypeEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy AddrTypeSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [AddrType] → Size Source #

NFData AddrType Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

Methods

rnfAddrType → () Source #

Eq AddrType Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

Ord AddrType Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

HeapWords AddrType Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

Methods

heapWordsAddrTypeInt Source #

NoThunks AddrType Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

type Rep AddrType Source # 
Instance details

Defined in Cardano.Chain.Common.AddrSpendingData

type Rep AddrType = D1 ('MetaData "AddrType" "Cardano.Chain.Common.AddrSpendingData" "cardano-ledger-byron-1.0.2.0-inplace" 'False) (C1 ('MetaCons "ATVerKey" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "ATRedeem" 'PrefixI 'False) (U1TypeType))

data AddrAttributes Source #

Additional information stored along with address. It's intended to be put into Attributes data type to make it extensible with softfork.

Instances

Instances details
ToJSON AddrAttributes Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

Generic AddrAttributes Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

Associated Types

type Rep AddrAttributesTypeType Source #

Show AddrAttributes Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

NFData AddrAttributes Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

Methods

rnfAddrAttributes → () Source #

Buildable AddrAttributes Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

Eq AddrAttributes Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

Ord AddrAttributes Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

HeapWords AddrAttributes Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

NoThunks AddrAttributes Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

FromCBOR (Attributes AddrAttributes) Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

ToCBOR (Attributes AddrAttributes) Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

DecCBOR (Attributes AddrAttributes) Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

EncCBOR (Attributes AddrAttributes) Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

type Rep AddrAttributes Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

type Rep AddrAttributes = D1 ('MetaData "AddrAttributes" "Cardano.Chain.Common.AddrAttributes" "cardano-ledger-byron-1.0.2.0-inplace" 'False) (C1 ('MetaCons "AddrAttributes" 'PrefixI 'True) (S1 ('MetaSel ('Just "aaVKDerivationPath") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe HDAddressPayload)) :*: S1 ('MetaSel ('Just "aaNetworkMagic") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NetworkMagic)))

newtype HDAddressPayload Source #

HDAddressPayload is a specific address attribute that was used by the Cardano wallet at mainnet launch, prior to moving to a BIP-44 style scheme.

It consisted of

  • serialized and encrypted using HDPassphrase derivation path from the root key to given descendant key (using ChaChaPoly1305 algorithm)
  • cryptographic tag

It is still distinguished as an attribute, but not used by the ledger, because the attributes size limits treat this attribute specially.

Instances

Instances details
ToJSON HDAddressPayload Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

Generic HDAddressPayload Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

Associated Types

type Rep HDAddressPayloadTypeType Source #

Show HDAddressPayload Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

FromCBOR HDAddressPayload Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

ToCBOR HDAddressPayload Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

DecCBOR HDAddressPayload Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

EncCBOR HDAddressPayload Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

NFData HDAddressPayload Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

Methods

rnfHDAddressPayload → () Source #

Eq HDAddressPayload Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

Ord HDAddressPayload Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

HeapWords HDAddressPayload Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

NoThunks HDAddressPayload Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

type Rep HDAddressPayload Source # 
Instance details

Defined in Cardano.Chain.Common.AddrAttributes

type Rep HDAddressPayload = D1 ('MetaData "HDAddressPayload" "Cardano.Chain.Common.AddrAttributes" "cardano-ledger-byron-1.0.2.0-inplace" 'True) (C1 ('MetaCons "HDAddressPayload" 'PrefixI 'True) (S1 ('MetaSel ('Just "getHDAddressPayload") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))