{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeApplications #-}
module Blockfrost.Pretty.Config
( PrettyConfig (..)
, adaDecimalConf
, adaSymbol
, lovelaceDecimalConf
, testnetConfig
) where
import Data.Default (Default (def))
import Data.Proxy (Proxy (..))
import Data.Text (Text)
import qualified Money
adaSymbol :: Text
adaSymbol :: Text
adaSymbol = Text
"₳"
data PrettyConfig = PrettyConfig {
PrettyConfig -> Bool
pcTestAda :: Bool
, PrettyConfig -> Bool
pcUnicode :: Bool
, PrettyConfig -> DecimalConf
pcAdaDecimalConf :: Money.DecimalConf
, PrettyConfig -> DecimalConf
pcLovelaceDecimalConf :: Money.DecimalConf
}
instance Default PrettyConfig where
def :: PrettyConfig
def =
PrettyConfig :: Bool -> Bool -> DecimalConf -> DecimalConf -> PrettyConfig
PrettyConfig {
pcTestAda :: Bool
pcTestAda = Bool
False
, pcUnicode :: Bool
pcUnicode = Bool
True
, pcAdaDecimalConf :: DecimalConf
pcAdaDecimalConf = DecimalConf
adaDecimalConf
, pcLovelaceDecimalConf :: DecimalConf
pcLovelaceDecimalConf = DecimalConf
lovelaceDecimalConf
}
testnetConfig :: PrettyConfig
testnetConfig :: PrettyConfig
testnetConfig = PrettyConfig
forall a. Default a => a
def { pcTestAda :: Bool
pcTestAda = Bool
True }
adaDecimalConf :: Money.DecimalConf
adaDecimalConf :: DecimalConf
adaDecimalConf =
DecimalConf
Money.defaultDecimalConf
{ decimalConf_digits :: Word8
Money.decimalConf_digits = Word8
6
, decimalConf_separators :: Separators
Money.decimalConf_separators = Separators
Money.separatorsDotNarrownbsp
, decimalConf_scale :: Scale
Money.decimalConf_scale =
Proxy '(1, 1) -> Scale
forall (proxy :: (Nat, Nat) -> *) (scale :: (Nat, Nat)).
GoodScale scale =>
proxy scale -> Scale
Money.scale (Proxy (UnitScale "ADA" "ada")
forall k (t :: k). Proxy t
Proxy @(Money.UnitScale "ADA" "ada"))
}
lovelaceDecimalConf :: Money.DecimalConf
lovelaceDecimalConf :: DecimalConf
lovelaceDecimalConf =
DecimalConf
Money.defaultDecimalConf
{ decimalConf_digits :: Word8
Money.decimalConf_digits = Word8
0
, decimalConf_separators :: Separators
Money.decimalConf_separators = Separators
Money.separatorsDotNarrownbsp
, decimalConf_scale :: Scale
Money.decimalConf_scale =
Proxy '(1000000, 1) -> Scale
forall (proxy :: (Nat, Nat) -> *) (scale :: (Nat, Nat)).
GoodScale scale =>
proxy scale -> Scale
Money.scale (Proxy (UnitScale "ADA" "lovelace")
forall k (t :: k). Proxy t
Proxy @(Money.UnitScale "ADA" "lovelace"))
}