{-# LANGUAGE NoImplicitPrelude #-}

module BtcLsp.Yesod.Data.Colored where

import qualified BtcLsp.Storage.Model as Model
import qualified BtcLsp.Storage.Model.SwapIntoLn as SwapIntoLn
import BtcLsp.Yesod.Data.BootstrapColor
import BtcLsp.Yesod.Import

class Colored a where
  color :: a -> Maybe BootstrapColor

instance Colored SwapIntoLn.UtxoInfo where
  color :: UtxoInfo -> Maybe BootstrapColor
color =
    Maybe BootstrapColor -> UtxoInfo -> Maybe BootstrapColor
forall a b. a -> b -> a
const Maybe BootstrapColor
forall a. Maybe a
Nothing

instance Colored (Entity Model.LnChan) where
  color :: Entity LnChan -> Maybe BootstrapColor
color =
    Maybe BootstrapColor -> Entity LnChan -> Maybe BootstrapColor
forall a b. a -> b -> a
const Maybe BootstrapColor
forall a. Maybe a
Nothing