{-# LANGUAGE NumericUnderscores #-}
module Blockfrost.Types.Cardano.Network
( Network (..)
, NetworkStake (..)
, NetworkSupply (..)
, NetworkEraSummary (..)
, NetworkEraBound (..)
, NetworkEraParameters (..)
) where
import Data.Time (NominalDiffTime)
import Data.Word (Word64)
import Deriving.Aeson
import Servant.Docs (ToSample (..), samples, singleSample)
import Blockfrost.Types.Shared
data NetworkSupply = NetworkSupply
{ NetworkSupply -> Lovelaces
_supplyMax :: Lovelaces
, NetworkSupply -> Lovelaces
_supplyTotal :: Lovelaces
, NetworkSupply -> Lovelaces
_supplyCirculating :: Lovelaces
, NetworkSupply -> Lovelaces
_supplyLocked :: Lovelaces
, NetworkSupply -> Lovelaces
_supplyTreasury :: Lovelaces
, NetworkSupply -> Lovelaces
_supplyReserves :: Lovelaces
}
deriving stock (Int -> NetworkSupply -> ShowS
[NetworkSupply] -> ShowS
NetworkSupply -> String
(Int -> NetworkSupply -> ShowS)
-> (NetworkSupply -> String)
-> ([NetworkSupply] -> ShowS)
-> Show NetworkSupply
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NetworkSupply -> ShowS
showsPrec :: Int -> NetworkSupply -> ShowS
$cshow :: NetworkSupply -> String
show :: NetworkSupply -> String
$cshowList :: [NetworkSupply] -> ShowS
showList :: [NetworkSupply] -> ShowS
Show, NetworkSupply -> NetworkSupply -> Bool
(NetworkSupply -> NetworkSupply -> Bool)
-> (NetworkSupply -> NetworkSupply -> Bool) -> Eq NetworkSupply
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NetworkSupply -> NetworkSupply -> Bool
== :: NetworkSupply -> NetworkSupply -> Bool
$c/= :: NetworkSupply -> NetworkSupply -> Bool
/= :: NetworkSupply -> NetworkSupply -> Bool
Eq, (forall x. NetworkSupply -> Rep NetworkSupply x)
-> (forall x. Rep NetworkSupply x -> NetworkSupply)
-> Generic NetworkSupply
forall x. Rep NetworkSupply x -> NetworkSupply
forall x. NetworkSupply -> Rep NetworkSupply x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. NetworkSupply -> Rep NetworkSupply x
from :: forall x. NetworkSupply -> Rep NetworkSupply x
$cto :: forall x. Rep NetworkSupply x -> NetworkSupply
to :: forall x. Rep NetworkSupply x -> NetworkSupply
Generic)
deriving (Maybe NetworkSupply
Value -> Parser [NetworkSupply]
Value -> Parser NetworkSupply
(Value -> Parser NetworkSupply)
-> (Value -> Parser [NetworkSupply])
-> Maybe NetworkSupply
-> FromJSON NetworkSupply
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser NetworkSupply
parseJSON :: Value -> Parser NetworkSupply
$cparseJSONList :: Value -> Parser [NetworkSupply]
parseJSONList :: Value -> Parser [NetworkSupply]
$comittedField :: Maybe NetworkSupply
omittedField :: Maybe NetworkSupply
FromJSON, [NetworkSupply] -> Value
[NetworkSupply] -> Encoding
NetworkSupply -> Bool
NetworkSupply -> Value
NetworkSupply -> Encoding
(NetworkSupply -> Value)
-> (NetworkSupply -> Encoding)
-> ([NetworkSupply] -> Value)
-> ([NetworkSupply] -> Encoding)
-> (NetworkSupply -> Bool)
-> ToJSON NetworkSupply
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: NetworkSupply -> Value
toJSON :: NetworkSupply -> Value
$ctoEncoding :: NetworkSupply -> Encoding
toEncoding :: NetworkSupply -> Encoding
$ctoJSONList :: [NetworkSupply] -> Value
toJSONList :: [NetworkSupply] -> Value
$ctoEncodingList :: [NetworkSupply] -> Encoding
toEncodingList :: [NetworkSupply] -> Encoding
$comitField :: NetworkSupply -> Bool
omitField :: NetworkSupply -> Bool
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_supply", CamelToSnake]] NetworkSupply
netSupplySample :: NetworkSupply
netSupplySample :: NetworkSupply
netSupplySample =
NetworkSupply
{ $sel:_supplyMax:NetworkSupply :: Lovelaces
_supplyMax = Discrete' "ADA" '(1000000, 1)
Lovelaces
45_000_000_000_000_000
, $sel:_supplyTotal:NetworkSupply :: Lovelaces
_supplyTotal = Discrete' "ADA" '(1000000, 1)
Lovelaces
32_890_715_183_299_160
, $sel:_supplyCirculating:NetworkSupply :: Lovelaces
_supplyCirculating = Discrete' "ADA" '(1000000, 1)
Lovelaces
32_412_601_976_210_393
, $sel:_supplyLocked:NetworkSupply :: Lovelaces
_supplyLocked = Discrete' "ADA" '(1000000, 1)
Lovelaces
125_006_953_355
, $sel:_supplyTreasury:NetworkSupply :: Lovelaces
_supplyTreasury = Discrete' "ADA" '(1000000, 1)
Lovelaces
98_635_632_000_000
, $sel:_supplyReserves:NetworkSupply :: Lovelaces
_supplyReserves = Discrete' "ADA" '(1000000, 1)
Lovelaces
46_635_632_000_000
}
instance ToSample NetworkSupply where
toSamples :: Proxy NetworkSupply -> [(Text, NetworkSupply)]
toSamples = [(Text, NetworkSupply)]
-> Proxy NetworkSupply -> [(Text, NetworkSupply)]
forall a. a -> Proxy NetworkSupply -> a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ([(Text, NetworkSupply)]
-> Proxy NetworkSupply -> [(Text, NetworkSupply)])
-> [(Text, NetworkSupply)]
-> Proxy NetworkSupply
-> [(Text, NetworkSupply)]
forall a b. (a -> b) -> a -> b
$ NetworkSupply -> [(Text, NetworkSupply)]
forall a. a -> [(Text, a)]
singleSample NetworkSupply
netSupplySample
data NetworkStake = NetworkStake
{ NetworkStake -> Lovelaces
_stakeLive :: Lovelaces
, NetworkStake -> Lovelaces
_stakeActive :: Lovelaces
}
deriving stock (Int -> NetworkStake -> ShowS
[NetworkStake] -> ShowS
NetworkStake -> String
(Int -> NetworkStake -> ShowS)
-> (NetworkStake -> String)
-> ([NetworkStake] -> ShowS)
-> Show NetworkStake
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NetworkStake -> ShowS
showsPrec :: Int -> NetworkStake -> ShowS
$cshow :: NetworkStake -> String
show :: NetworkStake -> String
$cshowList :: [NetworkStake] -> ShowS
showList :: [NetworkStake] -> ShowS
Show, NetworkStake -> NetworkStake -> Bool
(NetworkStake -> NetworkStake -> Bool)
-> (NetworkStake -> NetworkStake -> Bool) -> Eq NetworkStake
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NetworkStake -> NetworkStake -> Bool
== :: NetworkStake -> NetworkStake -> Bool
$c/= :: NetworkStake -> NetworkStake -> Bool
/= :: NetworkStake -> NetworkStake -> Bool
Eq, (forall x. NetworkStake -> Rep NetworkStake x)
-> (forall x. Rep NetworkStake x -> NetworkStake)
-> Generic NetworkStake
forall x. Rep NetworkStake x -> NetworkStake
forall x. NetworkStake -> Rep NetworkStake x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. NetworkStake -> Rep NetworkStake x
from :: forall x. NetworkStake -> Rep NetworkStake x
$cto :: forall x. Rep NetworkStake x -> NetworkStake
to :: forall x. Rep NetworkStake x -> NetworkStake
Generic)
deriving (Maybe NetworkStake
Value -> Parser [NetworkStake]
Value -> Parser NetworkStake
(Value -> Parser NetworkStake)
-> (Value -> Parser [NetworkStake])
-> Maybe NetworkStake
-> FromJSON NetworkStake
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser NetworkStake
parseJSON :: Value -> Parser NetworkStake
$cparseJSONList :: Value -> Parser [NetworkStake]
parseJSONList :: Value -> Parser [NetworkStake]
$comittedField :: Maybe NetworkStake
omittedField :: Maybe NetworkStake
FromJSON, [NetworkStake] -> Value
[NetworkStake] -> Encoding
NetworkStake -> Bool
NetworkStake -> Value
NetworkStake -> Encoding
(NetworkStake -> Value)
-> (NetworkStake -> Encoding)
-> ([NetworkStake] -> Value)
-> ([NetworkStake] -> Encoding)
-> (NetworkStake -> Bool)
-> ToJSON NetworkStake
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: NetworkStake -> Value
toJSON :: NetworkStake -> Value
$ctoEncoding :: NetworkStake -> Encoding
toEncoding :: NetworkStake -> Encoding
$ctoJSONList :: [NetworkStake] -> Value
toJSONList :: [NetworkStake] -> Value
$ctoEncodingList :: [NetworkStake] -> Encoding
toEncodingList :: [NetworkStake] -> Encoding
$comitField :: NetworkStake -> Bool
omitField :: NetworkStake -> Bool
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_stake", CamelToSnake]] NetworkStake
netStakeSample :: NetworkStake
netStakeSample :: NetworkStake
netStakeSample =
NetworkStake
{ $sel:_stakeLive:NetworkStake :: Lovelaces
_stakeLive = Discrete' "ADA" '(1000000, 1)
Lovelaces
23_204_950_463_991_654
, $sel:_stakeActive:NetworkStake :: Lovelaces
_stakeActive = Discrete' "ADA" '(1000000, 1)
Lovelaces
22_210_233_523_456_321
}
instance ToSample NetworkStake where
toSamples :: Proxy NetworkStake -> [(Text, NetworkStake)]
toSamples = [(Text, NetworkStake)]
-> Proxy NetworkStake -> [(Text, NetworkStake)]
forall a. a -> Proxy NetworkStake -> a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ([(Text, NetworkStake)]
-> Proxy NetworkStake -> [(Text, NetworkStake)])
-> [(Text, NetworkStake)]
-> Proxy NetworkStake
-> [(Text, NetworkStake)]
forall a b. (a -> b) -> a -> b
$ NetworkStake -> [(Text, NetworkStake)]
forall a. a -> [(Text, a)]
singleSample NetworkStake
netStakeSample
data Network = Network
{ Network -> NetworkSupply
_networkSupply :: NetworkSupply
, Network -> NetworkStake
_networkStake :: NetworkStake
}
deriving stock (Int -> Network -> ShowS
[Network] -> ShowS
Network -> String
(Int -> Network -> ShowS)
-> (Network -> String) -> ([Network] -> ShowS) -> Show Network
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Network -> ShowS
showsPrec :: Int -> Network -> ShowS
$cshow :: Network -> String
show :: Network -> String
$cshowList :: [Network] -> ShowS
showList :: [Network] -> ShowS
Show, Network -> Network -> Bool
(Network -> Network -> Bool)
-> (Network -> Network -> Bool) -> Eq Network
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Network -> Network -> Bool
== :: Network -> Network -> Bool
$c/= :: Network -> Network -> Bool
/= :: Network -> Network -> Bool
Eq, (forall x. Network -> Rep Network x)
-> (forall x. Rep Network x -> Network) -> Generic Network
forall x. Rep Network x -> Network
forall x. Network -> Rep Network x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Network -> Rep Network x
from :: forall x. Network -> Rep Network x
$cto :: forall x. Rep Network x -> Network
to :: forall x. Rep Network x -> Network
Generic)
deriving (Maybe Network
Value -> Parser [Network]
Value -> Parser Network
(Value -> Parser Network)
-> (Value -> Parser [Network]) -> Maybe Network -> FromJSON Network
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser Network
parseJSON :: Value -> Parser Network
$cparseJSONList :: Value -> Parser [Network]
parseJSONList :: Value -> Parser [Network]
$comittedField :: Maybe Network
omittedField :: Maybe Network
FromJSON, [Network] -> Value
[Network] -> Encoding
Network -> Bool
Network -> Value
Network -> Encoding
(Network -> Value)
-> (Network -> Encoding)
-> ([Network] -> Value)
-> ([Network] -> Encoding)
-> (Network -> Bool)
-> ToJSON Network
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: Network -> Value
toJSON :: Network -> Value
$ctoEncoding :: Network -> Encoding
toEncoding :: Network -> Encoding
$ctoJSONList :: [Network] -> Value
toJSONList :: [Network] -> Value
$ctoEncodingList :: [Network] -> Encoding
toEncodingList :: [Network] -> Encoding
$comitField :: Network -> Bool
omitField :: Network -> Bool
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_network", CamelToSnake]] Network
instance ToSample Network where
toSamples :: Proxy Network -> [(Text, Network)]
toSamples = [(Text, Network)] -> Proxy Network -> [(Text, Network)]
forall a. a -> Proxy Network -> a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ([(Text, Network)] -> Proxy Network -> [(Text, Network)])
-> [(Text, Network)] -> Proxy Network -> [(Text, Network)]
forall a b. (a -> b) -> a -> b
$ Network -> [(Text, Network)]
forall a. a -> [(Text, a)]
singleSample (Network -> [(Text, Network)]) -> Network -> [(Text, Network)]
forall a b. (a -> b) -> a -> b
$
NetworkSupply -> NetworkStake -> Network
Network NetworkSupply
netSupplySample NetworkStake
netStakeSample
data NetworkEraBound = NetworkEraBound
{ NetworkEraBound -> Epoch
_boundEpoch :: Epoch,
NetworkEraBound -> Slot
_boundSlot :: Slot,
NetworkEraBound -> NominalDiffTime
_boundTime :: NominalDiffTime
}
deriving stock (Int -> NetworkEraBound -> ShowS
[NetworkEraBound] -> ShowS
NetworkEraBound -> String
(Int -> NetworkEraBound -> ShowS)
-> (NetworkEraBound -> String)
-> ([NetworkEraBound] -> ShowS)
-> Show NetworkEraBound
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NetworkEraBound -> ShowS
showsPrec :: Int -> NetworkEraBound -> ShowS
$cshow :: NetworkEraBound -> String
show :: NetworkEraBound -> String
$cshowList :: [NetworkEraBound] -> ShowS
showList :: [NetworkEraBound] -> ShowS
Show, NetworkEraBound -> NetworkEraBound -> Bool
(NetworkEraBound -> NetworkEraBound -> Bool)
-> (NetworkEraBound -> NetworkEraBound -> Bool)
-> Eq NetworkEraBound
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NetworkEraBound -> NetworkEraBound -> Bool
== :: NetworkEraBound -> NetworkEraBound -> Bool
$c/= :: NetworkEraBound -> NetworkEraBound -> Bool
/= :: NetworkEraBound -> NetworkEraBound -> Bool
Eq, (forall x. NetworkEraBound -> Rep NetworkEraBound x)
-> (forall x. Rep NetworkEraBound x -> NetworkEraBound)
-> Generic NetworkEraBound
forall x. Rep NetworkEraBound x -> NetworkEraBound
forall x. NetworkEraBound -> Rep NetworkEraBound x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. NetworkEraBound -> Rep NetworkEraBound x
from :: forall x. NetworkEraBound -> Rep NetworkEraBound x
$cto :: forall x. Rep NetworkEraBound x -> NetworkEraBound
to :: forall x. Rep NetworkEraBound x -> NetworkEraBound
Generic)
deriving (Maybe NetworkEraBound
Value -> Parser [NetworkEraBound]
Value -> Parser NetworkEraBound
(Value -> Parser NetworkEraBound)
-> (Value -> Parser [NetworkEraBound])
-> Maybe NetworkEraBound
-> FromJSON NetworkEraBound
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser NetworkEraBound
parseJSON :: Value -> Parser NetworkEraBound
$cparseJSONList :: Value -> Parser [NetworkEraBound]
parseJSONList :: Value -> Parser [NetworkEraBound]
$comittedField :: Maybe NetworkEraBound
omittedField :: Maybe NetworkEraBound
FromJSON, [NetworkEraBound] -> Value
[NetworkEraBound] -> Encoding
NetworkEraBound -> Bool
NetworkEraBound -> Value
NetworkEraBound -> Encoding
(NetworkEraBound -> Value)
-> (NetworkEraBound -> Encoding)
-> ([NetworkEraBound] -> Value)
-> ([NetworkEraBound] -> Encoding)
-> (NetworkEraBound -> Bool)
-> ToJSON NetworkEraBound
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: NetworkEraBound -> Value
toJSON :: NetworkEraBound -> Value
$ctoEncoding :: NetworkEraBound -> Encoding
toEncoding :: NetworkEraBound -> Encoding
$ctoJSONList :: [NetworkEraBound] -> Value
toJSONList :: [NetworkEraBound] -> Value
$ctoEncodingList :: [NetworkEraBound] -> Encoding
toEncodingList :: [NetworkEraBound] -> Encoding
$comitField :: NetworkEraBound -> Bool
omitField :: NetworkEraBound -> Bool
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_bound", CamelToSnake]] NetworkEraBound
netEraBoundSample0 :: NetworkEraBound
netEraBoundSample0 :: NetworkEraBound
netEraBoundSample0 =
NetworkEraBound
{ $sel:_boundEpoch:NetworkEraBound :: Epoch
_boundEpoch = Epoch
4
, $sel:_boundSlot:NetworkEraBound :: Slot
_boundSlot = Slot
86_400
, $sel:_boundTime:NetworkEraBound :: NominalDiffTime
_boundTime = NominalDiffTime
1_728_000
}
netEraBoundSample1 :: NetworkEraBound
netEraBoundSample1 :: NetworkEraBound
netEraBoundSample1 =
NetworkEraBound
{ $sel:_boundEpoch:NetworkEraBound :: Epoch
_boundEpoch = Epoch
5
, $sel:_boundSlot:NetworkEraBound :: Slot
_boundSlot = Slot
518_400
, $sel:_boundTime:NetworkEraBound :: NominalDiffTime
_boundTime = NominalDiffTime
2_160_00
}
instance ToSample NetworkEraBound where
toSamples :: Proxy NetworkEraBound -> [(Text, NetworkEraBound)]
toSamples = [(Text, NetworkEraBound)]
-> Proxy NetworkEraBound -> [(Text, NetworkEraBound)]
forall a. a -> Proxy NetworkEraBound -> a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ([(Text, NetworkEraBound)]
-> Proxy NetworkEraBound -> [(Text, NetworkEraBound)])
-> [(Text, NetworkEraBound)]
-> Proxy NetworkEraBound
-> [(Text, NetworkEraBound)]
forall a b. (a -> b) -> a -> b
$ [NetworkEraBound] -> [(Text, NetworkEraBound)]
forall a. [a] -> [(Text, a)]
samples [NetworkEraBound
netEraBoundSample0, NetworkEraBound
netEraBoundSample1]
data NetworkEraParameters = NetworkEraParameters
{ NetworkEraParameters -> EpochLength
_parametersEpochLength :: EpochLength,
:: NominalDiffTime,
:: Word64
}
deriving stock (Int -> NetworkEraParameters -> ShowS
[NetworkEraParameters] -> ShowS
NetworkEraParameters -> String
(Int -> NetworkEraParameters -> ShowS)
-> (NetworkEraParameters -> String)
-> ([NetworkEraParameters] -> ShowS)
-> Show NetworkEraParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NetworkEraParameters -> ShowS
showsPrec :: Int -> NetworkEraParameters -> ShowS
$cshow :: NetworkEraParameters -> String
show :: NetworkEraParameters -> String
$cshowList :: [NetworkEraParameters] -> ShowS
showList :: [NetworkEraParameters] -> ShowS
Show, NetworkEraParameters -> NetworkEraParameters -> Bool
(NetworkEraParameters -> NetworkEraParameters -> Bool)
-> (NetworkEraParameters -> NetworkEraParameters -> Bool)
-> Eq NetworkEraParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NetworkEraParameters -> NetworkEraParameters -> Bool
== :: NetworkEraParameters -> NetworkEraParameters -> Bool
$c/= :: NetworkEraParameters -> NetworkEraParameters -> Bool
/= :: NetworkEraParameters -> NetworkEraParameters -> Bool
Eq, (forall x. NetworkEraParameters -> Rep NetworkEraParameters x)
-> (forall x. Rep NetworkEraParameters x -> NetworkEraParameters)
-> Generic NetworkEraParameters
forall x. Rep NetworkEraParameters x -> NetworkEraParameters
forall x. NetworkEraParameters -> Rep NetworkEraParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. NetworkEraParameters -> Rep NetworkEraParameters x
from :: forall x. NetworkEraParameters -> Rep NetworkEraParameters x
$cto :: forall x. Rep NetworkEraParameters x -> NetworkEraParameters
to :: forall x. Rep NetworkEraParameters x -> NetworkEraParameters
Generic)
deriving (Maybe NetworkEraParameters
Value -> Parser [NetworkEraParameters]
Value -> Parser NetworkEraParameters
(Value -> Parser NetworkEraParameters)
-> (Value -> Parser [NetworkEraParameters])
-> Maybe NetworkEraParameters
-> FromJSON NetworkEraParameters
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser NetworkEraParameters
parseJSON :: Value -> Parser NetworkEraParameters
$cparseJSONList :: Value -> Parser [NetworkEraParameters]
parseJSONList :: Value -> Parser [NetworkEraParameters]
$comittedField :: Maybe NetworkEraParameters
omittedField :: Maybe NetworkEraParameters
FromJSON, [NetworkEraParameters] -> Value
[NetworkEraParameters] -> Encoding
NetworkEraParameters -> Bool
NetworkEraParameters -> Value
NetworkEraParameters -> Encoding
(NetworkEraParameters -> Value)
-> (NetworkEraParameters -> Encoding)
-> ([NetworkEraParameters] -> Value)
-> ([NetworkEraParameters] -> Encoding)
-> (NetworkEraParameters -> Bool)
-> ToJSON NetworkEraParameters
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: NetworkEraParameters -> Value
toJSON :: NetworkEraParameters -> Value
$ctoEncoding :: NetworkEraParameters -> Encoding
toEncoding :: NetworkEraParameters -> Encoding
$ctoJSONList :: [NetworkEraParameters] -> Value
toJSONList :: [NetworkEraParameters] -> Value
$ctoEncodingList :: [NetworkEraParameters] -> Encoding
toEncodingList :: [NetworkEraParameters] -> Encoding
$comitField :: NetworkEraParameters -> Bool
omitField :: NetworkEraParameters -> Bool
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_parameters", CamelToSnake]] NetworkEraParameters
netEraParamSample :: NetworkEraParameters
netEraParamSample :: NetworkEraParameters
netEraParamSample =
NetworkEraParameters
{ $sel:_parametersEpochLength:NetworkEraParameters :: EpochLength
_parametersEpochLength = EpochLength
432_000
, $sel:_parametersSlotLength:NetworkEraParameters :: NominalDiffTime
_parametersSlotLength = NominalDiffTime
1
, $sel:_parametersSafeZone:NetworkEraParameters :: Word64
_parametersSafeZone = Word64
129_600
}
instance ToSample NetworkEraParameters where
toSamples :: Proxy NetworkEraParameters -> [(Text, NetworkEraParameters)]
toSamples = [(Text, NetworkEraParameters)]
-> Proxy NetworkEraParameters -> [(Text, NetworkEraParameters)]
forall a. a -> Proxy NetworkEraParameters -> a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ([(Text, NetworkEraParameters)]
-> Proxy NetworkEraParameters -> [(Text, NetworkEraParameters)])
-> [(Text, NetworkEraParameters)]
-> Proxy NetworkEraParameters
-> [(Text, NetworkEraParameters)]
forall a b. (a -> b) -> a -> b
$ NetworkEraParameters -> [(Text, NetworkEraParameters)]
forall a. a -> [(Text, a)]
singleSample NetworkEraParameters
netEraParamSample
data NetworkEraSummary = NetworkEraSummary
{ NetworkEraSummary -> NetworkEraBound
_networkEraStart :: NetworkEraBound,
NetworkEraSummary -> NetworkEraBound
_networkEraEnd :: NetworkEraBound,
NetworkEraSummary -> NetworkEraParameters
_networkEraParameters :: NetworkEraParameters
}
deriving stock (Int -> NetworkEraSummary -> ShowS
[NetworkEraSummary] -> ShowS
NetworkEraSummary -> String
(Int -> NetworkEraSummary -> ShowS)
-> (NetworkEraSummary -> String)
-> ([NetworkEraSummary] -> ShowS)
-> Show NetworkEraSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NetworkEraSummary -> ShowS
showsPrec :: Int -> NetworkEraSummary -> ShowS
$cshow :: NetworkEraSummary -> String
show :: NetworkEraSummary -> String
$cshowList :: [NetworkEraSummary] -> ShowS
showList :: [NetworkEraSummary] -> ShowS
Show, NetworkEraSummary -> NetworkEraSummary -> Bool
(NetworkEraSummary -> NetworkEraSummary -> Bool)
-> (NetworkEraSummary -> NetworkEraSummary -> Bool)
-> Eq NetworkEraSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NetworkEraSummary -> NetworkEraSummary -> Bool
== :: NetworkEraSummary -> NetworkEraSummary -> Bool
$c/= :: NetworkEraSummary -> NetworkEraSummary -> Bool
/= :: NetworkEraSummary -> NetworkEraSummary -> Bool
Eq, (forall x. NetworkEraSummary -> Rep NetworkEraSummary x)
-> (forall x. Rep NetworkEraSummary x -> NetworkEraSummary)
-> Generic NetworkEraSummary
forall x. Rep NetworkEraSummary x -> NetworkEraSummary
forall x. NetworkEraSummary -> Rep NetworkEraSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. NetworkEraSummary -> Rep NetworkEraSummary x
from :: forall x. NetworkEraSummary -> Rep NetworkEraSummary x
$cto :: forall x. Rep NetworkEraSummary x -> NetworkEraSummary
to :: forall x. Rep NetworkEraSummary x -> NetworkEraSummary
Generic)
deriving (Maybe NetworkEraSummary
Value -> Parser [NetworkEraSummary]
Value -> Parser NetworkEraSummary
(Value -> Parser NetworkEraSummary)
-> (Value -> Parser [NetworkEraSummary])
-> Maybe NetworkEraSummary
-> FromJSON NetworkEraSummary
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser NetworkEraSummary
parseJSON :: Value -> Parser NetworkEraSummary
$cparseJSONList :: Value -> Parser [NetworkEraSummary]
parseJSONList :: Value -> Parser [NetworkEraSummary]
$comittedField :: Maybe NetworkEraSummary
omittedField :: Maybe NetworkEraSummary
FromJSON, [NetworkEraSummary] -> Value
[NetworkEraSummary] -> Encoding
NetworkEraSummary -> Bool
NetworkEraSummary -> Value
NetworkEraSummary -> Encoding
(NetworkEraSummary -> Value)
-> (NetworkEraSummary -> Encoding)
-> ([NetworkEraSummary] -> Value)
-> ([NetworkEraSummary] -> Encoding)
-> (NetworkEraSummary -> Bool)
-> ToJSON NetworkEraSummary
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: NetworkEraSummary -> Value
toJSON :: NetworkEraSummary -> Value
$ctoEncoding :: NetworkEraSummary -> Encoding
toEncoding :: NetworkEraSummary -> Encoding
$ctoJSONList :: [NetworkEraSummary] -> Value
toJSONList :: [NetworkEraSummary] -> Value
$ctoEncodingList :: [NetworkEraSummary] -> Encoding
toEncodingList :: [NetworkEraSummary] -> Encoding
$comitField :: NetworkEraSummary -> Bool
omitField :: NetworkEraSummary -> Bool
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_networkEra", CamelToSnake]] NetworkEraSummary
instance ToSample NetworkEraSummary where
toSamples :: Proxy NetworkEraSummary -> [(Text, NetworkEraSummary)]
toSamples = [(Text, NetworkEraSummary)]
-> Proxy NetworkEraSummary -> [(Text, NetworkEraSummary)]
forall a. a -> Proxy NetworkEraSummary -> a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ([(Text, NetworkEraSummary)]
-> Proxy NetworkEraSummary -> [(Text, NetworkEraSummary)])
-> (NetworkEraSummary -> [(Text, NetworkEraSummary)])
-> NetworkEraSummary
-> Proxy NetworkEraSummary
-> [(Text, NetworkEraSummary)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NetworkEraSummary -> [(Text, NetworkEraSummary)]
forall a. a -> [(Text, a)]
singleSample (NetworkEraSummary
-> Proxy NetworkEraSummary -> [(Text, NetworkEraSummary)])
-> NetworkEraSummary
-> Proxy NetworkEraSummary
-> [(Text, NetworkEraSummary)]
forall a b. (a -> b) -> a -> b
$
NetworkEraSummary
{ $sel:_networkEraStart:NetworkEraSummary :: NetworkEraBound
_networkEraStart = NetworkEraBound
netEraBoundSample0
, $sel:_networkEraEnd:NetworkEraSummary :: NetworkEraBound
_networkEraEnd = NetworkEraBound
netEraBoundSample1
, $sel:_networkEraParameters:NetworkEraSummary :: NetworkEraParameters
_networkEraParameters = NetworkEraParameters
netEraParamSample
}