{-# LANGUAGE NumericUnderscores #-}
module Blockfrost.Types.Cardano.Genesis
( Genesis (..)
) where
import Deriving.Aeson
import Servant.Docs (ToSample (..), singleSample)
import Blockfrost.Types.Shared
data Genesis = Genesis
{ Genesis -> Rational
_genesisActiveSlotsCoefficient :: Rational
, Genesis -> Integer
_genesisUpdateQuorum :: Integer
, Genesis -> Lovelaces
_genesisMaxLovelaceSupply :: Lovelaces
, Genesis -> Integer
_genesisNetworkMagic :: Integer
, Genesis -> Integer
_genesisEpochLength :: Integer
, Genesis -> POSIXTime
_genesisSystemStart :: POSIXTime
, Genesis -> Integer
_genesisSlotsPerKesPeriod :: Integer
, Genesis -> Integer
_genesisSlotLength :: Integer
, Genesis -> Integer
_genesisMaxKesEvolutions :: Integer
, Genesis -> Integer
_genesisSecurityParam :: Integer
}
deriving stock (Int -> Genesis -> ShowS
[Genesis] -> ShowS
Genesis -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Genesis] -> ShowS
$cshowList :: [Genesis] -> ShowS
show :: Genesis -> String
$cshow :: Genesis -> String
showsPrec :: Int -> Genesis -> ShowS
$cshowsPrec :: Int -> Genesis -> ShowS
Show, Genesis -> Genesis -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Genesis -> Genesis -> Bool
$c/= :: Genesis -> Genesis -> Bool
== :: Genesis -> Genesis -> Bool
$c== :: Genesis -> Genesis -> Bool
Eq, forall x. Rep Genesis x -> Genesis
forall x. Genesis -> Rep Genesis x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Genesis x -> Genesis
$cfrom :: forall x. Genesis -> Rep Genesis x
Generic)
deriving (Value -> Parser [Genesis]
Value -> Parser Genesis
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [Genesis]
$cparseJSONList :: Value -> Parser [Genesis]
parseJSON :: Value -> Parser Genesis
$cparseJSON :: Value -> Parser Genesis
FromJSON, [Genesis] -> Encoding
[Genesis] -> Value
Genesis -> Encoding
Genesis -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [Genesis] -> Encoding
$ctoEncodingList :: [Genesis] -> Encoding
toJSONList :: [Genesis] -> Value
$ctoJSONList :: [Genesis] -> Value
toEncoding :: Genesis -> Encoding
$ctoEncoding :: Genesis -> Encoding
toJSON :: Genesis -> Value
$ctoJSON :: Genesis -> Value
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_genesis", CamelToSnake]] Genesis
instance ToSample Genesis where
toSamples :: Proxy Genesis -> [(Text, Genesis)]
toSamples Proxy Genesis
_ = forall a. a -> [(Text, a)]
singleSample forall a b. (a -> b) -> a -> b
$
Genesis
{ _genesisActiveSlotsCoefficient :: Rational
_genesisActiveSlotsCoefficient = Rational
0.05
, _genesisUpdateQuorum :: Integer
_genesisUpdateQuorum = Integer
5
, _genesisMaxLovelaceSupply :: Lovelaces
_genesisMaxLovelaceSupply = Discrete' "ADA" '(1000000, 1)
45_000_000_000_000_000
, _genesisNetworkMagic :: Integer
_genesisNetworkMagic = Integer
764824073
, _genesisEpochLength :: Integer
_genesisEpochLength = Integer
432_000
, _genesisSystemStart :: POSIXTime
_genesisSystemStart = POSIXTime
1506203091
, _genesisSlotsPerKesPeriod :: Integer
_genesisSlotsPerKesPeriod = Integer
129600
, _genesisSlotLength :: Integer
_genesisSlotLength = Integer
1
, _genesisMaxKesEvolutions :: Integer
_genesisMaxKesEvolutions = Integer
62
, _genesisSecurityParam :: Integer
_genesisSecurityParam = Integer
2160
}