Add lamassu-admin-elm to this repo (#185)

This commit is contained in:
Rafael Taranto 2018-10-08 16:29:06 -03:00 committed by Josh Harvey
parent 5ee7e40872
commit f4fc9d6328
134 changed files with 28171 additions and 83 deletions

View file

@ -0,0 +1,29 @@
module StatusDecoder exposing (..)
import StatusTypes exposing (..)
import Json.Decode exposing (..)
rateDecoder : Decoder Rate
rateDecoder =
map3 Rate
(field "crypto" string)
(field "bid" float)
(field "ask" float)
serverDecoder : Decoder ServerRec
serverDecoder =
map5 ServerRec
(field "up" bool)
(field "lastPing" (nullable string))
(field "rates" (list rateDecoder))
(field "machineStatus" string)
(field "wasConfigured" bool)
statusDecoder : Decoder StatusRec
statusDecoder =
map2 StatusRec
(field "server" serverDecoder)
(field "invalidConfigGroups" (list string))