zenith-install - Merge with branch rav001
Compiled with ghc-9.4.8
This commit is contained in:
commit
b0531d8db1
26 changed files with 1493 additions and 7 deletions
17
CHANGELOG.md
17
CHANGELOG.md
|
@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- GUI module
|
||||
- Address list
|
||||
- Transaction list
|
||||
- Balance display
|
||||
- Account selector
|
||||
- Menu for new addresses, accounts, wallets
|
||||
- Dialog to display and copy seed phrase
|
||||
- Dialog to add new address
|
||||
- Dialog to add new account
|
||||
- Dialog to add new wallet
|
||||
- Dialog to display transaction details and copy TX ID
|
||||
|
||||
|
||||
## [0.5.3.0-beta]
|
||||
|
||||
### Changed
|
||||
|
|
|
@ -19,6 +19,7 @@ import Text.Read (readMaybe)
|
|||
import ZcashHaskell.Types
|
||||
import Zenith.CLI
|
||||
import Zenith.Core (clearSync, testSync)
|
||||
import Zenith.GUI (runZenithGUI)
|
||||
import Zenith.Types (Config(..), ZcashAddress(..), ZcashPool(..), ZcashTx(..))
|
||||
import Zenith.Utils
|
||||
import Zenith.Zcashd
|
||||
|
@ -201,13 +202,13 @@ main :: IO ()
|
|||
main = do
|
||||
config <- load [ "$(HOME)/Zenith/zenith.cfg" ]
|
||||
args <- getArgs
|
||||
--dbFilePath <- require config "dbFilePath"
|
||||
dbFileName <- require config "dbFileName"
|
||||
nodeUser <- require config "nodeUser"
|
||||
nodePwd <- require config "nodePwd"
|
||||
zebraPort <- require config "zebraPort"
|
||||
zebraHost <- require config "zebraHost"
|
||||
dbFP <- getZenithPath
|
||||
let dbFilePath = dbFP ++ "zenith.db"
|
||||
let dbFilePath = dbFP ++ dbFileName
|
||||
let myConfig = Config (T.pack dbFilePath) zebraHost zebraPort
|
||||
if not (null args)
|
||||
then do
|
||||
|
@ -223,6 +224,7 @@ main = do
|
|||
}
|
||||
(root nodeUser nodePwd)
|
||||
"tui" -> runZenithTUI myConfig
|
||||
"gui" -> runZenithGUI myConfig
|
||||
"rescan" -> clearSync myConfig
|
||||
_ -> printUsage
|
||||
else printUsage
|
||||
|
|
BIN
assets/1F616_color.png
Normal file
BIN
assets/1F616_color.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
assets/1F928_color.png
Normal file
BIN
assets/1F928_color.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
BIN
assets/1F993.png
Normal file
BIN
assets/1F993.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
BIN
assets/2620_color.png
Normal file
BIN
assets/2620_color.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
BIN
assets/Atkinson-Hyperlegible-Bold-102.ttf
Normal file
BIN
assets/Atkinson-Hyperlegible-Bold-102.ttf
Normal file
Binary file not shown.
BIN
assets/Atkinson-Hyperlegible-BoldItalic-102.ttf
Normal file
BIN
assets/Atkinson-Hyperlegible-BoldItalic-102.ttf
Normal file
Binary file not shown.
BIN
assets/Atkinson-Hyperlegible-Font-License-2020-1104.pdf
Normal file
BIN
assets/Atkinson-Hyperlegible-Font-License-2020-1104.pdf
Normal file
Binary file not shown.
BIN
assets/Atkinson-Hyperlegible-Italic-102.ttf
Normal file
BIN
assets/Atkinson-Hyperlegible-Italic-102.ttf
Normal file
Binary file not shown.
BIN
assets/Atkinson-Hyperlegible-Regular-102.ttf
Normal file
BIN
assets/Atkinson-Hyperlegible-Regular-102.ttf
Normal file
Binary file not shown.
BIN
assets/DejaVuSansMono-Bold.ttf
Normal file
BIN
assets/DejaVuSansMono-Bold.ttf
Normal file
Binary file not shown.
BIN
assets/DejaVuSansMono-BoldOblique.ttf
Normal file
BIN
assets/DejaVuSansMono-BoldOblique.ttf
Normal file
Binary file not shown.
BIN
assets/DejaVuSansMono-Oblique.ttf
Normal file
BIN
assets/DejaVuSansMono-Oblique.ttf
Normal file
Binary file not shown.
BIN
assets/DejaVuSansMono.ttf
Normal file
BIN
assets/DejaVuSansMono.ttf
Normal file
Binary file not shown.
BIN
assets/OpenMoji-color-glyf_colr_1.ttf
Normal file
BIN
assets/OpenMoji-color-glyf_colr_1.ttf
Normal file
Binary file not shown.
BIN
assets/Roboto-Regular.ttf
Normal file
BIN
assets/Roboto-Regular.ttf
Normal file
Binary file not shown.
BIN
assets/remixicon.ttf
Normal file
BIN
assets/remixicon.ttf
Normal file
Binary file not shown.
|
@ -2,7 +2,7 @@ packages:
|
|||
./*.cabal
|
||||
zcash-haskell/zcash-haskell.cabal
|
||||
|
||||
with-compiler: ghc-9.6.5
|
||||
with-compiler: ghc-9.4.8
|
||||
|
||||
source-repository-package
|
||||
type: git
|
||||
|
|
|
@ -4,12 +4,20 @@ constraints: any.Cabal ==3.8.1.0,
|
|||
any.Clipboard ==2.3.2.0,
|
||||
any.HUnit ==1.6.2.0,
|
||||
any.Hclip ==3.0.0.4,
|
||||
any.JuicyPixels ==3.3.8,
|
||||
JuicyPixels -mmap,
|
||||
any.OneTuple ==0.4.1.1,
|
||||
any.OpenGLRaw ==3.3.4.1,
|
||||
OpenGLRaw -osandroid +usegles2 +useglxgetprocaddress +usenativewindowslibraries,
|
||||
any.QuickCheck ==2.14.3,
|
||||
QuickCheck -old-random +templatehaskell,
|
||||
any.RSA ==2.4.1,
|
||||
any.SHA ==1.6.4.4,
|
||||
SHA -exe,
|
||||
any.StateVar ==1.2.2,
|
||||
any.X11 ==1.10.3,
|
||||
X11 -pedantic,
|
||||
any.adjunctions ==4.4.2,
|
||||
any.aeson ==2.2.1.0,
|
||||
aeson +ordered-keymap,
|
||||
any.alex ==3.5.1.0,
|
||||
|
@ -30,8 +38,11 @@ constraints: any.Cabal ==3.8.1.0,
|
|||
any.attoparsec ==0.14.4,
|
||||
attoparsec -developer,
|
||||
any.attoparsec-aeson ==2.2.0.1,
|
||||
any.authenticate-oauth ==1.7,
|
||||
any.auto-update ==0.1.6,
|
||||
any.base ==4.17.2.1,
|
||||
any.base-compat ==0.13.1,
|
||||
any.base-compat-batteries ==0.13.1,
|
||||
any.base-orphans ==0.9.1,
|
||||
any.base16 ==1.0,
|
||||
any.base16-bytestring ==1.0.2.0,
|
||||
|
@ -54,14 +65,20 @@ constraints: any.Cabal ==3.8.1.0,
|
|||
any.byteorder ==1.0.4,
|
||||
any.bytes ==0.17.3,
|
||||
any.bytestring ==0.11.5.3,
|
||||
any.bytestring-builder ==0.10.8.2.0,
|
||||
bytestring-builder +bytestring_has_builder,
|
||||
any.bytestring-to-vector ==0.3.0.1,
|
||||
any.c2hs ==0.28.8,
|
||||
c2hs +base3 -regression,
|
||||
any.cabal-doctest ==1.0.9,
|
||||
any.call-stack ==0.4.0,
|
||||
any.case-insensitive ==1.2.1.0,
|
||||
any.cborg ==0.2.10.0,
|
||||
cborg +optimize-gmp,
|
||||
any.cereal ==0.5.8.3,
|
||||
cereal -bytestring-builder,
|
||||
any.clock ==0.8.4,
|
||||
clock -llvm,
|
||||
any.colour ==2.3.6,
|
||||
any.comonad ==5.0.8,
|
||||
comonad +containers +distributive +indexed-traversable,
|
||||
|
@ -78,6 +95,7 @@ constraints: any.Cabal ==3.8.1.0,
|
|||
any.cookie ==0.4.6,
|
||||
any.crypto-api ==0.13.3,
|
||||
crypto-api -all_cpolys,
|
||||
any.crypto-pubkey-types ==0.4.3,
|
||||
any.crypton ==0.34,
|
||||
crypton -check_alignment +integer-gmp -old_toolchain_inliner +support_aesni +support_deepseq +support_pclmuldq +support_rdrand -support_sse +use_target_attributes,
|
||||
any.crypton-connection ==0.3.2,
|
||||
|
@ -100,20 +118,30 @@ constraints: any.Cabal ==3.8.1.0,
|
|||
distributive +semigroups +tagged,
|
||||
any.dlist ==1.0,
|
||||
dlist -werror,
|
||||
any.double-conversion ==2.0.5.0,
|
||||
double-conversion -developer +embedded_double_conversion,
|
||||
any.easy-file ==0.2.5,
|
||||
any.entropy ==0.4.1.10,
|
||||
entropy -donotgetentropy,
|
||||
any.envy ==2.1.3.0,
|
||||
any.esqueleto ==3.5.11.2,
|
||||
any.exceptions ==0.10.5,
|
||||
any.extra ==1.7.14,
|
||||
any.fast-logger ==3.2.2,
|
||||
any.filepath ==1.4.2.2,
|
||||
any.fixed ==0.3,
|
||||
any.foldable1-classes-compat ==0.1,
|
||||
foldable1-classes-compat +tagged,
|
||||
any.foreign-rust ==0.1.0,
|
||||
any.foreign-store ==0.2.1,
|
||||
any.formatting ==7.2.0,
|
||||
formatting -no-double-conversion,
|
||||
any.free ==5.2,
|
||||
any.generic-deriving ==1.14.5,
|
||||
generic-deriving +base-4-9,
|
||||
any.generically ==0.1.1,
|
||||
any.generics-sop ==0.5.1.4,
|
||||
any.ghc ==9.6.5,
|
||||
any.ghc ==9.4.8,
|
||||
any.ghc-bignum ==1.3,
|
||||
any.ghc-boot ==9.4.8,
|
||||
any.ghc-boot-th ==9.4.8,
|
||||
|
@ -150,11 +178,18 @@ constraints: any.Cabal ==3.8.1.0,
|
|||
any.integer-gmp ==1.1,
|
||||
any.integer-logarithms ==1.0.3.1,
|
||||
integer-logarithms -check-bounds +integer-gmp,
|
||||
any.invariant ==0.6.3,
|
||||
any.iproute ==1.7.12,
|
||||
any.kan-extensions ==5.2.5,
|
||||
any.language-c ==0.9.3,
|
||||
language-c -allwarnings +iecfpextension +usebytestrings,
|
||||
any.lens ==5.2.3,
|
||||
lens -benchmark-uniplate -dump-splices +inlining -j +test-hunit +test-properties +test-templates +trustworthy,
|
||||
any.lens-aeson ==1.2.3,
|
||||
any.lift-type ==0.1.1.1,
|
||||
any.lifted-base ==0.2.3.12,
|
||||
any.linear ==1.22,
|
||||
linear -herbie +template-haskell,
|
||||
any.megaparsec ==9.6.1,
|
||||
megaparsec -dev,
|
||||
any.memory ==0.18.0,
|
||||
|
@ -169,14 +204,19 @@ constraints: any.Cabal ==3.8.1.0,
|
|||
any.monad-loops ==0.4.3,
|
||||
monad-loops +base4,
|
||||
any.mono-traversable ==1.0.17.0,
|
||||
any.monomer ==1.6.0.1,
|
||||
monomer -examples,
|
||||
any.mtl ==2.2.2,
|
||||
any.murmur3 ==1.0.5,
|
||||
any.nanovg ==0.8.1.0,
|
||||
nanovg -examples -gl2 -gles3 -stb_truetype,
|
||||
any.network ==3.1.4.0,
|
||||
network -devel,
|
||||
any.network-uri ==2.6.4.2,
|
||||
any.old-locale ==1.0.0.7,
|
||||
any.old-time ==1.1.0.4,
|
||||
any.os-string ==2.0.2,
|
||||
any.parallel ==3.2.2.0,
|
||||
any.parsec ==3.1.16.1,
|
||||
any.parser-combinators ==1.3.0,
|
||||
parser-combinators -dev,
|
||||
|
@ -189,11 +229,17 @@ constraints: any.Cabal ==3.8.1.0,
|
|||
any.pretty ==1.1.3.6,
|
||||
any.primitive ==0.9.0.0,
|
||||
any.process ==1.6.18.0,
|
||||
any.profunctors ==5.6.2,
|
||||
any.psqueues ==0.2.8.0,
|
||||
any.pureMD5 ==2.1.4,
|
||||
pureMD5 -test,
|
||||
any.qrcode-core ==0.9.9,
|
||||
any.qrcode-juicypixels ==0.8.5,
|
||||
any.quickcheck-io ==0.2.0,
|
||||
any.quickcheck-transformer ==0.3.1.2,
|
||||
any.random ==1.2.1.2,
|
||||
any.reflection ==2.1.7,
|
||||
reflection -slow +template-haskell,
|
||||
any.regex-base ==0.94.0.2,
|
||||
any.regex-compat ==0.95.2.1,
|
||||
any.regex-posix ==0.96.0.1,
|
||||
|
@ -205,11 +251,15 @@ constraints: any.Cabal ==3.8.1.0,
|
|||
any.safe-exceptions ==0.1.7.4,
|
||||
any.scientific ==0.3.7.0,
|
||||
scientific -bytestring-builder -integer-simple,
|
||||
any.sdl2 ==2.5.5.0,
|
||||
sdl2 -examples -no-linear -opengl-example +pkgconfig +recent-ish,
|
||||
any.secp256k1-haskell ==1.2.0,
|
||||
any.semialign ==1.3,
|
||||
semialign +semigroupoids,
|
||||
any.semigroupoids ==6.0.0.1,
|
||||
semigroupoids +comonad +containers +contravariant +distributive +tagged +unordered-containers,
|
||||
any.semigroups ==0.20,
|
||||
semigroups +binary +bytestring -bytestring-builder +containers +deepseq +hashable +tagged +template-haskell +text +transformers +unordered-containers,
|
||||
any.serialise ==0.2.6.1,
|
||||
serialise +newtime15,
|
||||
any.silently ==1.2.5.3,
|
||||
|
@ -227,6 +277,7 @@ constraints: any.Cabal ==3.8.1.0,
|
|||
any.string-conversions ==0.4.0.1,
|
||||
any.structured-cli ==2.7.0.1,
|
||||
structured-cli -debug,
|
||||
any.system-cxx-std-lib ==1.0,
|
||||
any.tagged ==0.8.8,
|
||||
tagged +deepseq +transformers,
|
||||
any.template-haskell ==2.19.0.0,
|
||||
|
@ -236,6 +287,8 @@ constraints: any.Cabal ==3.8.1.0,
|
|||
any.text-iso8601 ==0.1,
|
||||
any.text-short ==0.1.5,
|
||||
text-short -asserts,
|
||||
any.text-show ==3.10.4,
|
||||
text-show +base-4-9 +integer-gmp +new-functor-classes +template-haskell-2-11,
|
||||
any.text-zipper ==0.13,
|
||||
any.tf-random ==0.5,
|
||||
any.th-abstraction ==0.6.0.0,
|
||||
|
@ -246,6 +299,8 @@ constraints: any.Cabal ==3.8.1.0,
|
|||
any.time ==1.12.2,
|
||||
any.time-compat ==1.9.6.1,
|
||||
time-compat -old-locale,
|
||||
any.time-locale-compat ==0.1.1.5,
|
||||
time-locale-compat -old-locale,
|
||||
any.tls ==2.0.2,
|
||||
tls -devel,
|
||||
any.transformers ==0.5.6.2,
|
||||
|
@ -280,6 +335,8 @@ constraints: any.Cabal ==3.8.1.0,
|
|||
any.wide-word ==0.1.6.0,
|
||||
any.witherable ==0.4.2,
|
||||
any.word-wrap ==0.5,
|
||||
any.zlib ==0.7.0.0,
|
||||
any.wreq ==0.5.4.3,
|
||||
wreq -aws -developer +doctest -httpbin,
|
||||
any.zlib ==0.6.3.0,
|
||||
zlib -bundled-c-zlib +non-blocking-ffi +pkg-config
|
||||
index-state: hackage.haskell.org 2024-04-07T10:14:52Z
|
||||
|
|
|
@ -77,6 +77,7 @@ import Zenith.Types
|
|||
, TransparentSpendingKeyDB
|
||||
, UnifiedAddressDB(..)
|
||||
, ZcashNetDB(..)
|
||||
, ZcashPool(..)
|
||||
)
|
||||
|
||||
share
|
||||
|
@ -252,6 +253,15 @@ share
|
|||
abaddress T.Text
|
||||
UniqueABA abaddress
|
||||
deriving Show Eq
|
||||
QrCode
|
||||
address WalletAddressId OnDeleteCascade OnUpdateCascade
|
||||
version ZcashPool
|
||||
bytes BS.ByteString
|
||||
height Int
|
||||
width Int
|
||||
name T.Text
|
||||
UniqueQr address version
|
||||
deriving Show Eq
|
||||
|]
|
||||
|
||||
-- * Database functions
|
||||
|
@ -422,6 +432,16 @@ getWalletAddresses pool w = do
|
|||
addrs <- mapM (getAddresses pool . entityKey) accs
|
||||
return $ concat addrs
|
||||
|
||||
getExternalAddresses :: ConnectionPool -> IO [Entity WalletAddress]
|
||||
getExternalAddresses pool = do
|
||||
runNoLoggingT $
|
||||
PS.retryOnBusy $
|
||||
flip PS.runSqlPool pool $ do
|
||||
select $ do
|
||||
addrs <- from $ table @WalletAddress
|
||||
where_ $ addrs ^. WalletAddressScope ==. val (ScopeDB External)
|
||||
return addrs
|
||||
|
||||
-- | Returns the largest address index for the given account
|
||||
getMaxAddress ::
|
||||
ConnectionPool -- ^ The database path
|
||||
|
@ -554,6 +574,41 @@ getZcashTransactions pool b =
|
|||
orderBy [asc $ txs ^. ZcashTransactionBlock]
|
||||
return txs
|
||||
|
||||
-- ** QR codes
|
||||
-- | Functions to manage the QR codes stored in the database
|
||||
saveQrCode ::
|
||||
ConnectionPool -- ^ the connection pool
|
||||
-> QrCode
|
||||
-> NoLoggingT IO (Maybe (Entity QrCode))
|
||||
saveQrCode pool qr =
|
||||
PS.retryOnBusy $ flip PS.runSqlPool pool $ insertUniqueEntity qr
|
||||
|
||||
getQrCodes ::
|
||||
ConnectionPool -- ^ the connection pool
|
||||
-> WalletAddressId
|
||||
-> IO [Entity QrCode]
|
||||
getQrCodes pool wId =
|
||||
runNoLoggingT $
|
||||
PS.retryOnBusy $
|
||||
flip PS.runSqlPool pool $ do
|
||||
select $ do
|
||||
qrs <- from $ table @QrCode
|
||||
where_ $ qrs ^. QrCodeAddress ==. val wId
|
||||
return qrs
|
||||
|
||||
getQrCode :: ConnectionPool -> ZcashPool -> WalletAddressId -> IO (Maybe QrCode)
|
||||
getQrCode pool zp wId = do
|
||||
r <-
|
||||
runNoLoggingT $
|
||||
PS.retryOnBusy $
|
||||
flip PS.runSqlPool pool $ do
|
||||
selectOne $ do
|
||||
qrs <- from $ table @QrCode
|
||||
where_ $ qrs ^. QrCodeAddress ==. val wId
|
||||
where_ $ qrs ^. QrCodeVersion ==. val zp
|
||||
return qrs
|
||||
return $ entityVal <$> r
|
||||
|
||||
-- * Wallet
|
||||
-- | Get the block of the last transaction known to the wallet
|
||||
getMaxWalletBlock ::
|
||||
|
|
1034
src/Zenith/GUI.hs
Normal file
1034
src/Zenith/GUI.hs
Normal file
File diff suppressed because it is too large
Load diff
304
src/Zenith/GUI/Theme.hs
Normal file
304
src/Zenith/GUI/Theme.hs
Normal file
|
@ -0,0 +1,304 @@
|
|||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module Zenith.GUI.Theme
|
||||
( zenithTheme
|
||||
) where
|
||||
|
||||
import Data.Default
|
||||
import Lens.Micro ((&), (+~), (.~), (?~), (^.), at, set)
|
||||
import Monomer
|
||||
import Monomer.Core.Themes.BaseTheme
|
||||
import Monomer.Core.Themes.SampleThemes
|
||||
import Monomer.Graphics (rgbHex, transparent)
|
||||
import Monomer.Graphics.ColorTable
|
||||
import qualified Monomer.Lens as L
|
||||
|
||||
baseTextStyle :: TextStyle
|
||||
baseTextStyle = def & L.fontSize ?~ FontSize 10 & L.fontColor ?~ black
|
||||
|
||||
hiliteTextStyle :: TextStyle
|
||||
hiliteTextStyle = def & L.fontSize ?~ FontSize 10 & L.fontColor ?~ white
|
||||
|
||||
zenithTheme :: Theme
|
||||
zenithTheme =
|
||||
baseTheme zgoThemeColors & L.basic . L.labelStyle . L.text ?~ baseTextStyle &
|
||||
L.hover .
|
||||
L.tooltipStyle . L.text ?~
|
||||
baseTextStyle &
|
||||
L.hover .
|
||||
L.labelStyle . L.text ?~
|
||||
baseTextStyle &
|
||||
L.basic .
|
||||
L.dialogTitleStyle . L.text ?~
|
||||
(baseTextStyle & L.fontSize ?~ FontSize 12 & L.font ?~ "Bold") &
|
||||
L.hover .
|
||||
L.dialogTitleStyle . L.text ?~
|
||||
(baseTextStyle & L.fontSize ?~ FontSize 12 & L.font ?~ "Bold") &
|
||||
L.basic .
|
||||
L.btnStyle . L.text ?~
|
||||
baseTextStyle &
|
||||
L.hover .
|
||||
L.btnStyle . L.text ?~
|
||||
baseTextStyle &
|
||||
L.focus .
|
||||
L.btnStyle . L.text ?~
|
||||
baseTextStyle &
|
||||
L.focusHover .
|
||||
L.btnStyle . L.text ?~
|
||||
baseTextStyle &
|
||||
L.active .
|
||||
L.btnStyle . L.text ?~
|
||||
baseTextStyle &
|
||||
L.basic .
|
||||
L.btnMainStyle . L.text ?~
|
||||
hiliteTextStyle &
|
||||
L.hover .
|
||||
L.btnMainStyle . L.text ?~
|
||||
hiliteTextStyle &
|
||||
L.focus .
|
||||
L.btnMainStyle . L.text ?~
|
||||
hiliteTextStyle &
|
||||
L.focusHover .
|
||||
L.btnMainStyle . L.text ?~
|
||||
hiliteTextStyle &
|
||||
L.active .
|
||||
L.btnMainStyle . L.text ?~
|
||||
hiliteTextStyle &
|
||||
L.basic .
|
||||
L.textFieldStyle . L.text ?~
|
||||
baseTextStyle &
|
||||
L.hover .
|
||||
L.textFieldStyle . L.text ?~
|
||||
baseTextStyle &
|
||||
L.focus .
|
||||
L.textFieldStyle . L.text ?~
|
||||
baseTextStyle &
|
||||
L.active .
|
||||
L.textFieldStyle . L.text ?~
|
||||
baseTextStyle &
|
||||
L.focusHover .
|
||||
L.textFieldStyle . L.text ?~
|
||||
baseTextStyle
|
||||
|
||||
zenithThemeColors :: BaseThemeColors
|
||||
zenithThemeColors =
|
||||
BaseThemeColors
|
||||
{ clearColor = gray01
|
||||
, sectionColor = gray01
|
||||
, btnFocusBorder = blue09
|
||||
, btnBgBasic = gray07b
|
||||
, btnBgHover = gray08
|
||||
, btnBgFocus = gray07c
|
||||
, btnBgActive = gray06
|
||||
, btnBgDisabled = gray05
|
||||
, btnText = gray02
|
||||
, btnTextDisabled = gray01
|
||||
, btnMainFocusBorder = blue08
|
||||
, btnMainBgBasic = btnColor
|
||||
, btnMainBgHover = btnHiLite
|
||||
, btnMainBgFocus = btnColor
|
||||
, btnMainBgActive = btnHiLite
|
||||
, btnMainBgDisabled = blue04
|
||||
, btnMainText = white
|
||||
, btnMainTextDisabled = gray08
|
||||
, dialogBg = gray01
|
||||
, dialogBorder = gray01
|
||||
, dialogText = white
|
||||
, dialogTitleText = white
|
||||
, emptyOverlay = gray05 & L.a .~ 0.8
|
||||
, shadow = gray00 & L.a .~ 0.33
|
||||
, externalLinkBasic = blue07
|
||||
, externalLinkHover = blue08
|
||||
, externalLinkFocus = blue07
|
||||
, externalLinkActive = blue06
|
||||
, externalLinkDisabled = gray06
|
||||
, iconBg = gray08
|
||||
, iconFg = gray01
|
||||
, inputIconFg = black
|
||||
, inputBorder = gray02
|
||||
, inputFocusBorder = blue08
|
||||
, inputBgBasic = gray04
|
||||
, inputBgHover = gray06
|
||||
, inputBgFocus = gray05
|
||||
, inputBgActive = gray03
|
||||
, inputBgDisabled = gray07
|
||||
, inputFgBasic = gray06
|
||||
, inputFgHover = blue08
|
||||
, inputFgFocus = blue08
|
||||
, inputFgActive = blue07
|
||||
, inputFgDisabled = gray07
|
||||
, inputSndBasic = gray05
|
||||
, inputSndHover = gray06
|
||||
, inputSndFocus = gray05
|
||||
, inputSndActive = gray05
|
||||
, inputSndDisabled = gray03
|
||||
, inputHlBasic = gray07
|
||||
, inputHlHover = blue08
|
||||
, inputHlFocus = blue08
|
||||
, inputHlActive = blue08
|
||||
, inputHlDisabled = gray08
|
||||
, inputSelBasic = gray06
|
||||
, inputSelFocus = blue06
|
||||
, inputText = white
|
||||
, inputTextDisabled = gray02
|
||||
, labelText = white
|
||||
, scrollBarBasic = gray01 & L.a .~ 0.2
|
||||
, scrollThumbBasic = gray07 & L.a .~ 0.6
|
||||
, scrollBarHover = gray01 & L.a .~ 0.4
|
||||
, scrollThumbHover = gray07 & L.a .~ 0.8
|
||||
, slMainBg = gray00
|
||||
, slNormalBgBasic = transparent
|
||||
, slNormalBgHover = gray05
|
||||
, slNormalText = white
|
||||
, slNormalFocusBorder = blue08
|
||||
, slSelectedBgBasic = gray04
|
||||
, slSelectedBgHover = gray05
|
||||
, slSelectedText = white
|
||||
, slSelectedFocusBorder = blue08
|
||||
, tooltipBorder = gray05
|
||||
, tooltipBg = rgbHex "#1D212B"
|
||||
, tooltipText = white
|
||||
}
|
||||
|
||||
zgoThemeColors =
|
||||
BaseThemeColors
|
||||
{ clearColor = gray10 -- gray12,
|
||||
, sectionColor = gray09 -- gray11,
|
||||
, btnFocusBorder = blue08
|
||||
, btnBgBasic = gray07
|
||||
, btnBgHover = gray07c
|
||||
, btnBgFocus = gray07b
|
||||
, btnBgActive = gray06
|
||||
, btnBgDisabled = gray05
|
||||
, btnText = gray02
|
||||
, btnTextDisabled = gray02
|
||||
, btnMainFocusBorder = blue09
|
||||
, btnMainBgBasic = btnColor
|
||||
, btnMainBgHover = btnHiLite
|
||||
, btnMainBgFocus = btnColor
|
||||
, btnMainBgActive = btnHiLite
|
||||
, btnMainBgDisabled = blue04
|
||||
, btnMainText = white
|
||||
, btnMainTextDisabled = white
|
||||
, dialogBg = white
|
||||
, dialogBorder = white
|
||||
, dialogText = black
|
||||
, dialogTitleText = black
|
||||
, emptyOverlay = gray07 & L.a .~ 0.8
|
||||
, shadow = gray00 & L.a .~ 0.2
|
||||
, externalLinkBasic = blue07
|
||||
, externalLinkHover = blue08
|
||||
, externalLinkFocus = blue07
|
||||
, externalLinkActive = blue06
|
||||
, externalLinkDisabled = gray06
|
||||
, iconBg = gray07
|
||||
, iconFg = gray01
|
||||
, inputIconFg = black
|
||||
, inputBorder = gray06
|
||||
, inputFocusBorder = blue07
|
||||
, inputBgBasic = gray10
|
||||
, inputBgHover = white
|
||||
, inputBgFocus = white
|
||||
, inputBgActive = gray09
|
||||
, inputBgDisabled = gray05
|
||||
, inputFgBasic = gray05
|
||||
, inputFgHover = blue07
|
||||
, inputFgFocus = blue07
|
||||
, inputFgActive = blue06
|
||||
, inputFgDisabled = gray04
|
||||
, inputSndBasic = gray04
|
||||
, inputSndHover = gray05
|
||||
, inputSndFocus = gray05
|
||||
, inputSndActive = gray04
|
||||
, inputSndDisabled = gray03
|
||||
, inputHlBasic = gray06
|
||||
, inputHlHover = blue07
|
||||
, inputHlFocus = blue07
|
||||
, inputHlActive = blue06
|
||||
, inputHlDisabled = gray05
|
||||
, inputSelBasic = gray07
|
||||
, inputSelFocus = blue08
|
||||
, inputText = black
|
||||
, inputTextDisabled = gray02
|
||||
, labelText = black
|
||||
, scrollBarBasic = gray03 & L.a .~ 0.2
|
||||
, scrollThumbBasic = gray01 & L.a .~ 0.2
|
||||
, scrollBarHover = gray07 & L.a .~ 0.8
|
||||
, scrollThumbHover = gray05 & L.a .~ 0.8
|
||||
, slMainBg = white
|
||||
, slNormalBgBasic = transparent
|
||||
, slNormalBgHover = gray09
|
||||
, slNormalText = black
|
||||
, slNormalFocusBorder = blue07
|
||||
, slSelectedBgBasic = gray08
|
||||
, slSelectedBgHover = gray09
|
||||
, slSelectedText = black
|
||||
, slSelectedFocusBorder = blue07
|
||||
, tooltipBorder = gray08
|
||||
, tooltipBg = gray07
|
||||
, tooltipText = black
|
||||
}
|
||||
|
||||
--black = rgbHex "#000000"
|
||||
{-white = rgbHex "#FFFFFF"-}
|
||||
btnColor = rgbHex "#ff5722" --rgbHex "#1818B2"
|
||||
|
||||
btnHiLite = rgbHex "#207DE8"
|
||||
|
||||
blue01 = rgbHex "#002159"
|
||||
|
||||
blue02 = rgbHex "#01337D"
|
||||
|
||||
blue03 = rgbHex "#03449E"
|
||||
|
||||
blue04 = rgbHex "#0552B5"
|
||||
|
||||
blue05 = rgbHex "#0967D2"
|
||||
|
||||
blue05b = rgbHex "#0F6BD7"
|
||||
|
||||
blue05c = rgbHex "#1673DE"
|
||||
|
||||
blue06 = rgbHex "#2186EB"
|
||||
|
||||
blue06b = rgbHex "#2489EE"
|
||||
|
||||
blue06c = rgbHex "#2B8FF6"
|
||||
|
||||
blue07 = rgbHex "#47A3F3"
|
||||
|
||||
blue07b = rgbHex "#50A6F6"
|
||||
|
||||
blue07c = rgbHex "#57ACFC"
|
||||
|
||||
blue08 = rgbHex "#7CC4FA"
|
||||
|
||||
blue09 = rgbHex "#BAE3FF"
|
||||
|
||||
blue10 = rgbHex "#E6F6FF"
|
||||
|
||||
gray00 = rgbHex "#111111"
|
||||
|
||||
gray01 = rgbHex "#2E2E2E"
|
||||
|
||||
gray02 = rgbHex "#393939"
|
||||
|
||||
gray03 = rgbHex "#515151"
|
||||
|
||||
gray04 = rgbHex "#626262"
|
||||
|
||||
gray05 = rgbHex "#7E7E7E"
|
||||
|
||||
gray06 = rgbHex "#9E9E9E"
|
||||
|
||||
gray07 = rgbHex "#B1B1B1"
|
||||
|
||||
gray07b = rgbHex "#B4B4B4"
|
||||
|
||||
gray07c = rgbHex "#BBBBBB"
|
||||
|
||||
gray08 = rgbHex "#CFCFCF"
|
||||
|
||||
gray09 = rgbHex "#E1E1E1"
|
||||
|
||||
gray10 = rgbHex "#F7F7F7"
|
|
@ -143,7 +143,9 @@ data ZcashPool
|
|||
| Sprout
|
||||
| Sapling
|
||||
| Orchard
|
||||
deriving (Show, Eq, Generic, ToJSON)
|
||||
deriving (Show, Read, Eq, Generic, ToJSON)
|
||||
|
||||
derivePersistField "ZcashPool"
|
||||
|
||||
instance FromJSON ZcashPool where
|
||||
parseJSON =
|
||||
|
|
|
@ -13,6 +13,7 @@ import System.Directory
|
|||
import Text.Regex.Posix
|
||||
import ZcashHaskell.Orchard (encodeUnifiedAddress, isValidUnifiedAddress)
|
||||
import ZcashHaskell.Sapling (isValidShieldedAddress)
|
||||
import ZcashHaskell.Types (ZcashNet(..))
|
||||
import Zenith.Types
|
||||
( AddressGroup(..)
|
||||
, UnifiedAddressDB(..)
|
||||
|
@ -40,6 +41,12 @@ displayTaz s
|
|||
| abs s < 100000000 = show (fromIntegral s / 100000) ++ " mTAZ"
|
||||
| otherwise = show (fromIntegral s / 100000000) ++ " TAZ"
|
||||
|
||||
displayAmount :: ZcashNet -> Integer -> T.Text
|
||||
displayAmount n a =
|
||||
if n == MainNet
|
||||
then T.pack $ displayZec a
|
||||
else T.pack $ displayTaz a
|
||||
|
||||
-- | Helper function to display abbreviated Unified Address
|
||||
showAddress :: UnifiedAddressDB -> T.Text
|
||||
showAddress u = T.take 20 t <> "..."
|
||||
|
|
10
zenith.cabal
10
zenith.cabal
|
@ -27,6 +27,8 @@ library
|
|||
ghc-options: -Wall -Wunused-imports
|
||||
exposed-modules:
|
||||
Zenith.CLI
|
||||
Zenith.GUI
|
||||
Zenith.GUI.Theme
|
||||
Zenith.Core
|
||||
Zenith.DB
|
||||
Zenith.Types
|
||||
|
@ -44,6 +46,7 @@ library
|
|||
, base64-bytestring
|
||||
, brick
|
||||
, bytestring
|
||||
, data-default
|
||||
, esqueleto
|
||||
, resource-pool
|
||||
, binary
|
||||
|
@ -52,15 +55,19 @@ library
|
|||
, vty-crossplatform
|
||||
, secp256k1-haskell
|
||||
, pureMD5
|
||||
, ghc >=9.6.5
|
||||
, ghc >=9.4.8
|
||||
, haskoin-core
|
||||
, hexstring
|
||||
, http-client
|
||||
, http-conduit
|
||||
, http-types
|
||||
, JuicyPixels
|
||||
, qrcode-core
|
||||
, qrcode-juicypixels
|
||||
, microlens
|
||||
, microlens-mtl
|
||||
, microlens-th
|
||||
, monomer
|
||||
, mtl
|
||||
, persistent
|
||||
, Hclip
|
||||
|
@ -72,6 +79,7 @@ library
|
|||
, regex-posix
|
||||
, scientific
|
||||
, text
|
||||
, text-show
|
||||
, time
|
||||
, vector
|
||||
, vty
|
||||
|
|
Loading…
Reference in a new issue