{-# OPTIONS_HADDOCK prune #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveGeneric #-}
module Lightning.Protocol.BOLT7.Types (
ChainHash
, chainHash
, getChainHash
, mainnetChainHash
, ShortChannelId
, shortChannelId
, mkShortChannelId
, getShortChannelId
, scidBlockHeight
, scidTxIndex
, scidOutputIndex
, formatScid
, ChannelId
, channelId
, getChannelId
, Signature
, signature
, getSignature
, Point
, point
, getPoint
, NodeId
, nodeId
, getNodeId
, RgbColor
, rgbColor
, getRgbColor
, Alias
, alias
, getAlias
, Timestamp
, FeatureBits
, featureBits
, getFeatureBits
, Address(..)
, IPv4Addr
, ipv4Addr
, getIPv4Addr
, IPv6Addr
, ipv6Addr
, getIPv6Addr
, TorV3Addr
, torV3Addr
, getTorV3Addr
, MessageFlags(..)
, encodeMessageFlags
, decodeMessageFlags
, ChannelFlags(..)
, encodeChannelFlags
, decodeChannelFlags
, CltvExpiryDelta(..)
, FeeBaseMsat(..)
, FeeProportionalMillionths(..)
, HtlcMinimumMsat(..)
, HtlcMaximumMsat(..)
, chainHashLen
, shortChannelIdLen
, channelIdLen
, signatureLen
, pointLen
, nodeIdLen
, rgbColorLen
, aliasLen
, ipv4AddrLen
, ipv6AddrLen
, torV3AddrLen
) where
import Control.DeepSeq (NFData)
import Data.Bits (shiftL, shiftR, (.&.), (.|.))
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
import Data.Word (Word8, Word16, Word32, Word64)
import GHC.Generics (Generic)
chainHashLen :: Int
chainHashLen :: Int
chainHashLen = Int
32
{-# INLINE chainHashLen #-}
shortChannelIdLen :: Int
shortChannelIdLen :: Int
shortChannelIdLen = Int
8
{-# INLINE shortChannelIdLen #-}
channelIdLen :: Int
channelIdLen :: Int
channelIdLen = Int
32
{-# INLINE channelIdLen #-}
signatureLen :: Int
signatureLen :: Int
signatureLen = Int
64
{-# INLINE signatureLen #-}
pointLen :: Int
pointLen :: Int
pointLen = Int
33
{-# INLINE pointLen #-}
nodeIdLen :: Int
nodeIdLen :: Int
nodeIdLen = Int
33
{-# INLINE nodeIdLen #-}
rgbColorLen :: Int
rgbColorLen :: Int
rgbColorLen = Int
3
{-# INLINE rgbColorLen #-}
aliasLen :: Int
aliasLen :: Int
aliasLen = Int
32
{-# INLINE aliasLen #-}
ipv4AddrLen :: Int
ipv4AddrLen :: Int
ipv4AddrLen = Int
4
{-# INLINE ipv4AddrLen #-}
ipv6AddrLen :: Int
ipv6AddrLen :: Int
ipv6AddrLen = Int
16
{-# INLINE ipv6AddrLen #-}
torV3AddrLen :: Int
torV3AddrLen :: Int
torV3AddrLen = Int
35
{-# INLINE torV3AddrLen #-}
newtype ChainHash = ChainHash { ChainHash -> ByteString
getChainHash :: ByteString }
deriving (ChainHash -> ChainHash -> Bool
(ChainHash -> ChainHash -> Bool)
-> (ChainHash -> ChainHash -> Bool) -> Eq ChainHash
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ChainHash -> ChainHash -> Bool
== :: ChainHash -> ChainHash -> Bool
$c/= :: ChainHash -> ChainHash -> Bool
/= :: ChainHash -> ChainHash -> Bool
Eq, Int -> ChainHash -> ShowS
[ChainHash] -> ShowS
ChainHash -> String
(Int -> ChainHash -> ShowS)
-> (ChainHash -> String)
-> ([ChainHash] -> ShowS)
-> Show ChainHash
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ChainHash -> ShowS
showsPrec :: Int -> ChainHash -> ShowS
$cshow :: ChainHash -> String
show :: ChainHash -> String
$cshowList :: [ChainHash] -> ShowS
showList :: [ChainHash] -> ShowS
Show, (forall x. ChainHash -> Rep ChainHash x)
-> (forall x. Rep ChainHash x -> ChainHash) -> Generic ChainHash
forall x. Rep ChainHash x -> ChainHash
forall x. ChainHash -> Rep ChainHash x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ChainHash -> Rep ChainHash x
from :: forall x. ChainHash -> Rep ChainHash x
$cto :: forall x. Rep ChainHash x -> ChainHash
to :: forall x. Rep ChainHash x -> ChainHash
Generic)
instance NFData ChainHash
chainHash :: ByteString -> Maybe ChainHash
chainHash :: ByteString -> Maybe ChainHash
chainHash !ByteString
bs
| ByteString -> Int
BS.length ByteString
bs Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
chainHashLen = ChainHash -> Maybe ChainHash
forall a. a -> Maybe a
Just (ByteString -> ChainHash
ChainHash ByteString
bs)
| Bool
otherwise = Maybe ChainHash
forall a. Maybe a
Nothing
{-# INLINE chainHash #-}
mainnetChainHash :: ChainHash
mainnetChainHash :: ChainHash
mainnetChainHash = ByteString -> ChainHash
ChainHash (ByteString -> ChainHash) -> ByteString -> ChainHash
forall a b. (a -> b) -> a -> b
$ [Word8] -> ByteString
BS.pack
[ Word8
0x6f, Word8
0xe2, Word8
0x8c, Word8
0x0a, Word8
0xb6, Word8
0xf1, Word8
0xb3, Word8
0x72
, Word8
0xc1, Word8
0xa6, Word8
0xa2, Word8
0x46, Word8
0xae, Word8
0x63, Word8
0xf7, Word8
0x4f
, Word8
0x93, Word8
0x1e, Word8
0x83, Word8
0x65, Word8
0xe1, Word8
0x5a, Word8
0x08, Word8
0x9c
, Word8
0x68, Word8
0xd6, Word8
0x19, Word8
0x00, Word8
0x00, Word8
0x00, Word8
0x00, Word8
0x00
]
newtype ShortChannelId = ShortChannelId { ShortChannelId -> ByteString
getShortChannelId :: ByteString }
deriving (ShortChannelId -> ShortChannelId -> Bool
(ShortChannelId -> ShortChannelId -> Bool)
-> (ShortChannelId -> ShortChannelId -> Bool) -> Eq ShortChannelId
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ShortChannelId -> ShortChannelId -> Bool
== :: ShortChannelId -> ShortChannelId -> Bool
$c/= :: ShortChannelId -> ShortChannelId -> Bool
/= :: ShortChannelId -> ShortChannelId -> Bool
Eq, Int -> ShortChannelId -> ShowS
[ShortChannelId] -> ShowS
ShortChannelId -> String
(Int -> ShortChannelId -> ShowS)
-> (ShortChannelId -> String)
-> ([ShortChannelId] -> ShowS)
-> Show ShortChannelId
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ShortChannelId -> ShowS
showsPrec :: Int -> ShortChannelId -> ShowS
$cshow :: ShortChannelId -> String
show :: ShortChannelId -> String
$cshowList :: [ShortChannelId] -> ShowS
showList :: [ShortChannelId] -> ShowS
Show, (forall x. ShortChannelId -> Rep ShortChannelId x)
-> (forall x. Rep ShortChannelId x -> ShortChannelId)
-> Generic ShortChannelId
forall x. Rep ShortChannelId x -> ShortChannelId
forall x. ShortChannelId -> Rep ShortChannelId x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ShortChannelId -> Rep ShortChannelId x
from :: forall x. ShortChannelId -> Rep ShortChannelId x
$cto :: forall x. Rep ShortChannelId x -> ShortChannelId
to :: forall x. Rep ShortChannelId x -> ShortChannelId
Generic)
instance NFData ShortChannelId
shortChannelId :: ByteString -> Maybe ShortChannelId
shortChannelId :: ByteString -> Maybe ShortChannelId
shortChannelId !ByteString
bs
| ByteString -> Int
BS.length ByteString
bs Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
shortChannelIdLen = ShortChannelId -> Maybe ShortChannelId
forall a. a -> Maybe a
Just (ByteString -> ShortChannelId
ShortChannelId ByteString
bs)
| Bool
otherwise = Maybe ShortChannelId
forall a. Maybe a
Nothing
{-# INLINE shortChannelId #-}
mkShortChannelId
:: Word32
-> Word32
-> Word16
-> ShortChannelId
mkShortChannelId :: Word32 -> Word32 -> Word16 -> ShortChannelId
mkShortChannelId !Word32
block !Word32
txIdx !Word16
outIdx = ByteString -> ShortChannelId
ShortChannelId (ByteString -> ShortChannelId) -> ByteString -> ShortChannelId
forall a b. (a -> b) -> a -> b
$ [Word8] -> ByteString
BS.pack
[ Word32 -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral ((Word32
block Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
`shiftR` Int
16) Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
.&. Word32
0xff) :: Word8
, Word32 -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral ((Word32
block Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
`shiftR` Int
8) Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
.&. Word32
0xff)
, Word32 -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
block Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
.&. Word32
0xff)
, Word32 -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral ((Word32
txIdx Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
`shiftR` Int
16) Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
.&. Word32
0xff)
, Word32 -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral ((Word32
txIdx Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
`shiftR` Int
8) Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
.&. Word32
0xff)
, Word32 -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
txIdx Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
.&. Word32
0xff)
, Word16 -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral ((Word16
outIdx Word16 -> Int -> Word16
forall a. Bits a => a -> Int -> a
`shiftR` Int
8) Word16 -> Word16 -> Word16
forall a. Bits a => a -> a -> a
.&. Word16
0xff)
, Word16 -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word16
outIdx Word16 -> Word16 -> Word16
forall a. Bits a => a -> a -> a
.&. Word16
0xff)
]
{-# INLINE mkShortChannelId #-}
scidBlockHeight :: ShortChannelId -> Word32
scidBlockHeight :: ShortChannelId -> Word32
scidBlockHeight (ShortChannelId ByteString
bs) =
let b0 :: Word32
b0 = Word8 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (HasCallStack => ByteString -> Int -> Word8
ByteString -> Int -> Word8
BS.index ByteString
bs Int
0)
b1 :: Word32
b1 = Word8 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (HasCallStack => ByteString -> Int -> Word8
ByteString -> Int -> Word8
BS.index ByteString
bs Int
1)
b2 :: Word32
b2 = Word8 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (HasCallStack => ByteString -> Int -> Word8
ByteString -> Int -> Word8
BS.index ByteString
bs Int
2)
in (Word32
b0 Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
`shiftL` Int
16) Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
.|. (Word32
b1 Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
`shiftL` Int
8) Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
.|. Word32
b2
{-# INLINE scidBlockHeight #-}
scidTxIndex :: ShortChannelId -> Word32
scidTxIndex :: ShortChannelId -> Word32
scidTxIndex (ShortChannelId ByteString
bs) =
let b3 :: Word32
b3 = Word8 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (HasCallStack => ByteString -> Int -> Word8
ByteString -> Int -> Word8
BS.index ByteString
bs Int
3)
b4 :: Word32
b4 = Word8 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (HasCallStack => ByteString -> Int -> Word8
ByteString -> Int -> Word8
BS.index ByteString
bs Int
4)
b5 :: Word32
b5 = Word8 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (HasCallStack => ByteString -> Int -> Word8
ByteString -> Int -> Word8
BS.index ByteString
bs Int
5)
in (Word32
b3 Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
`shiftL` Int
16) Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
.|. (Word32
b4 Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
`shiftL` Int
8) Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
.|. Word32
b5
{-# INLINE scidTxIndex #-}
scidOutputIndex :: ShortChannelId -> Word16
scidOutputIndex :: ShortChannelId -> Word16
scidOutputIndex (ShortChannelId ByteString
bs) =
let b6 :: Word16
b6 = Word8 -> Word16
forall a b. (Integral a, Num b) => a -> b
fromIntegral (HasCallStack => ByteString -> Int -> Word8
ByteString -> Int -> Word8
BS.index ByteString
bs Int
6)
b7 :: Word16
b7 = Word8 -> Word16
forall a b. (Integral a, Num b) => a -> b
fromIntegral (HasCallStack => ByteString -> Int -> Word8
ByteString -> Int -> Word8
BS.index ByteString
bs Int
7)
in (Word16
b6 Word16 -> Int -> Word16
forall a. Bits a => a -> Int -> a
`shiftL` Int
8) Word16 -> Word16 -> Word16
forall a. Bits a => a -> a -> a
.|. Word16
b7
{-# INLINE scidOutputIndex #-}
formatScid :: ShortChannelId -> String
formatScid :: ShortChannelId -> String
formatScid ShortChannelId
scid =
Word32 -> String
forall a. Show a => a -> String
show (ShortChannelId -> Word32
scidBlockHeight ShortChannelId
scid) String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
"x" String -> ShowS
forall a. [a] -> [a] -> [a]
++
Word32 -> String
forall a. Show a => a -> String
show (ShortChannelId -> Word32
scidTxIndex ShortChannelId
scid) String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
"x" String -> ShowS
forall a. [a] -> [a] -> [a]
++
Word16 -> String
forall a. Show a => a -> String
show (ShortChannelId -> Word16
scidOutputIndex ShortChannelId
scid)
{-# INLINE formatScid #-}
newtype ChannelId = ChannelId { ChannelId -> ByteString
getChannelId :: ByteString }
deriving (ChannelId -> ChannelId -> Bool
(ChannelId -> ChannelId -> Bool)
-> (ChannelId -> ChannelId -> Bool) -> Eq ChannelId
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ChannelId -> ChannelId -> Bool
== :: ChannelId -> ChannelId -> Bool
$c/= :: ChannelId -> ChannelId -> Bool
/= :: ChannelId -> ChannelId -> Bool
Eq, Int -> ChannelId -> ShowS
[ChannelId] -> ShowS
ChannelId -> String
(Int -> ChannelId -> ShowS)
-> (ChannelId -> String)
-> ([ChannelId] -> ShowS)
-> Show ChannelId
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ChannelId -> ShowS
showsPrec :: Int -> ChannelId -> ShowS
$cshow :: ChannelId -> String
show :: ChannelId -> String
$cshowList :: [ChannelId] -> ShowS
showList :: [ChannelId] -> ShowS
Show, (forall x. ChannelId -> Rep ChannelId x)
-> (forall x. Rep ChannelId x -> ChannelId) -> Generic ChannelId
forall x. Rep ChannelId x -> ChannelId
forall x. ChannelId -> Rep ChannelId x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ChannelId -> Rep ChannelId x
from :: forall x. ChannelId -> Rep ChannelId x
$cto :: forall x. Rep ChannelId x -> ChannelId
to :: forall x. Rep ChannelId x -> ChannelId
Generic)
instance NFData ChannelId
channelId :: ByteString -> Maybe ChannelId
channelId :: ByteString -> Maybe ChannelId
channelId !ByteString
bs
| ByteString -> Int
BS.length ByteString
bs Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
channelIdLen = ChannelId -> Maybe ChannelId
forall a. a -> Maybe a
Just (ByteString -> ChannelId
ChannelId ByteString
bs)
| Bool
otherwise = Maybe ChannelId
forall a. Maybe a
Nothing
{-# INLINE channelId #-}
newtype Signature = Signature { Signature -> ByteString
getSignature :: ByteString }
deriving (Signature -> Signature -> Bool
(Signature -> Signature -> Bool)
-> (Signature -> Signature -> Bool) -> Eq Signature
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Signature -> Signature -> Bool
== :: Signature -> Signature -> Bool
$c/= :: Signature -> Signature -> Bool
/= :: Signature -> Signature -> Bool
Eq, Int -> Signature -> ShowS
[Signature] -> ShowS
Signature -> String
(Int -> Signature -> ShowS)
-> (Signature -> String)
-> ([Signature] -> ShowS)
-> Show Signature
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Signature -> ShowS
showsPrec :: Int -> Signature -> ShowS
$cshow :: Signature -> String
show :: Signature -> String
$cshowList :: [Signature] -> ShowS
showList :: [Signature] -> ShowS
Show, (forall x. Signature -> Rep Signature x)
-> (forall x. Rep Signature x -> Signature) -> Generic Signature
forall x. Rep Signature x -> Signature
forall x. Signature -> Rep Signature x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Signature -> Rep Signature x
from :: forall x. Signature -> Rep Signature x
$cto :: forall x. Rep Signature x -> Signature
to :: forall x. Rep Signature x -> Signature
Generic)
instance NFData Signature
signature :: ByteString -> Maybe Signature
signature :: ByteString -> Maybe Signature
signature !ByteString
bs
| ByteString -> Int
BS.length ByteString
bs Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
signatureLen = Signature -> Maybe Signature
forall a. a -> Maybe a
Just (ByteString -> Signature
Signature ByteString
bs)
| Bool
otherwise = Maybe Signature
forall a. Maybe a
Nothing
{-# INLINE signature #-}
newtype Point = Point { Point -> ByteString
getPoint :: ByteString }
deriving (Point -> Point -> Bool
(Point -> Point -> Bool) -> (Point -> Point -> Bool) -> Eq Point
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Point -> Point -> Bool
== :: Point -> Point -> Bool
$c/= :: Point -> Point -> Bool
/= :: Point -> Point -> Bool
Eq, Int -> Point -> ShowS
[Point] -> ShowS
Point -> String
(Int -> Point -> ShowS)
-> (Point -> String) -> ([Point] -> ShowS) -> Show Point
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Point -> ShowS
showsPrec :: Int -> Point -> ShowS
$cshow :: Point -> String
show :: Point -> String
$cshowList :: [Point] -> ShowS
showList :: [Point] -> ShowS
Show, (forall x. Point -> Rep Point x)
-> (forall x. Rep Point x -> Point) -> Generic Point
forall x. Rep Point x -> Point
forall x. Point -> Rep Point x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Point -> Rep Point x
from :: forall x. Point -> Rep Point x
$cto :: forall x. Rep Point x -> Point
to :: forall x. Rep Point x -> Point
Generic)
instance NFData Point
point :: ByteString -> Maybe Point
point :: ByteString -> Maybe Point
point !ByteString
bs
| ByteString -> Int
BS.length ByteString
bs Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
pointLen = Point -> Maybe Point
forall a. a -> Maybe a
Just (ByteString -> Point
Point ByteString
bs)
| Bool
otherwise = Maybe Point
forall a. Maybe a
Nothing
{-# INLINE point #-}
newtype NodeId = NodeId { NodeId -> ByteString
getNodeId :: ByteString }
deriving (NodeId -> NodeId -> Bool
(NodeId -> NodeId -> Bool)
-> (NodeId -> NodeId -> Bool) -> Eq NodeId
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NodeId -> NodeId -> Bool
== :: NodeId -> NodeId -> Bool
$c/= :: NodeId -> NodeId -> Bool
/= :: NodeId -> NodeId -> Bool
Eq, Eq NodeId
Eq NodeId =>
(NodeId -> NodeId -> Ordering)
-> (NodeId -> NodeId -> Bool)
-> (NodeId -> NodeId -> Bool)
-> (NodeId -> NodeId -> Bool)
-> (NodeId -> NodeId -> Bool)
-> (NodeId -> NodeId -> NodeId)
-> (NodeId -> NodeId -> NodeId)
-> Ord NodeId
NodeId -> NodeId -> Bool
NodeId -> NodeId -> Ordering
NodeId -> NodeId -> NodeId
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: NodeId -> NodeId -> Ordering
compare :: NodeId -> NodeId -> Ordering
$c< :: NodeId -> NodeId -> Bool
< :: NodeId -> NodeId -> Bool
$c<= :: NodeId -> NodeId -> Bool
<= :: NodeId -> NodeId -> Bool
$c> :: NodeId -> NodeId -> Bool
> :: NodeId -> NodeId -> Bool
$c>= :: NodeId -> NodeId -> Bool
>= :: NodeId -> NodeId -> Bool
$cmax :: NodeId -> NodeId -> NodeId
max :: NodeId -> NodeId -> NodeId
$cmin :: NodeId -> NodeId -> NodeId
min :: NodeId -> NodeId -> NodeId
Ord, Int -> NodeId -> ShowS
[NodeId] -> ShowS
NodeId -> String
(Int -> NodeId -> ShowS)
-> (NodeId -> String) -> ([NodeId] -> ShowS) -> Show NodeId
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NodeId -> ShowS
showsPrec :: Int -> NodeId -> ShowS
$cshow :: NodeId -> String
show :: NodeId -> String
$cshowList :: [NodeId] -> ShowS
showList :: [NodeId] -> ShowS
Show, (forall x. NodeId -> Rep NodeId x)
-> (forall x. Rep NodeId x -> NodeId) -> Generic NodeId
forall x. Rep NodeId x -> NodeId
forall x. NodeId -> Rep NodeId x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. NodeId -> Rep NodeId x
from :: forall x. NodeId -> Rep NodeId x
$cto :: forall x. Rep NodeId x -> NodeId
to :: forall x. Rep NodeId x -> NodeId
Generic)
instance NFData NodeId
nodeId :: ByteString -> Maybe NodeId
nodeId :: ByteString -> Maybe NodeId
nodeId !ByteString
bs
| ByteString -> Int
BS.length ByteString
bs Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
nodeIdLen = NodeId -> Maybe NodeId
forall a. a -> Maybe a
Just (ByteString -> NodeId
NodeId ByteString
bs)
| Bool
otherwise = Maybe NodeId
forall a. Maybe a
Nothing
{-# INLINE nodeId #-}
newtype RgbColor = RgbColor { RgbColor -> ByteString
getRgbColor :: ByteString }
deriving (RgbColor -> RgbColor -> Bool
(RgbColor -> RgbColor -> Bool)
-> (RgbColor -> RgbColor -> Bool) -> Eq RgbColor
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RgbColor -> RgbColor -> Bool
== :: RgbColor -> RgbColor -> Bool
$c/= :: RgbColor -> RgbColor -> Bool
/= :: RgbColor -> RgbColor -> Bool
Eq, Int -> RgbColor -> ShowS
[RgbColor] -> ShowS
RgbColor -> String
(Int -> RgbColor -> ShowS)
-> (RgbColor -> String) -> ([RgbColor] -> ShowS) -> Show RgbColor
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RgbColor -> ShowS
showsPrec :: Int -> RgbColor -> ShowS
$cshow :: RgbColor -> String
show :: RgbColor -> String
$cshowList :: [RgbColor] -> ShowS
showList :: [RgbColor] -> ShowS
Show, (forall x. RgbColor -> Rep RgbColor x)
-> (forall x. Rep RgbColor x -> RgbColor) -> Generic RgbColor
forall x. Rep RgbColor x -> RgbColor
forall x. RgbColor -> Rep RgbColor x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. RgbColor -> Rep RgbColor x
from :: forall x. RgbColor -> Rep RgbColor x
$cto :: forall x. Rep RgbColor x -> RgbColor
to :: forall x. Rep RgbColor x -> RgbColor
Generic)
instance NFData RgbColor
rgbColor :: ByteString -> Maybe RgbColor
rgbColor :: ByteString -> Maybe RgbColor
rgbColor !ByteString
bs
| ByteString -> Int
BS.length ByteString
bs Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
rgbColorLen = RgbColor -> Maybe RgbColor
forall a. a -> Maybe a
Just (ByteString -> RgbColor
RgbColor ByteString
bs)
| Bool
otherwise = Maybe RgbColor
forall a. Maybe a
Nothing
{-# INLINE rgbColor #-}
newtype Alias = Alias { Alias -> ByteString
getAlias :: ByteString }
deriving (Alias -> Alias -> Bool
(Alias -> Alias -> Bool) -> (Alias -> Alias -> Bool) -> Eq Alias
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Alias -> Alias -> Bool
== :: Alias -> Alias -> Bool
$c/= :: Alias -> Alias -> Bool
/= :: Alias -> Alias -> Bool
Eq, Int -> Alias -> ShowS
[Alias] -> ShowS
Alias -> String
(Int -> Alias -> ShowS)
-> (Alias -> String) -> ([Alias] -> ShowS) -> Show Alias
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Alias -> ShowS
showsPrec :: Int -> Alias -> ShowS
$cshow :: Alias -> String
show :: Alias -> String
$cshowList :: [Alias] -> ShowS
showList :: [Alias] -> ShowS
Show, (forall x. Alias -> Rep Alias x)
-> (forall x. Rep Alias x -> Alias) -> Generic Alias
forall x. Rep Alias x -> Alias
forall x. Alias -> Rep Alias x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Alias -> Rep Alias x
from :: forall x. Alias -> Rep Alias x
$cto :: forall x. Rep Alias x -> Alias
to :: forall x. Rep Alias x -> Alias
Generic)
instance NFData Alias
alias :: ByteString -> Maybe Alias
alias :: ByteString -> Maybe Alias
alias !ByteString
bs
| ByteString -> Int
BS.length ByteString
bs Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
aliasLen = Alias -> Maybe Alias
forall a. a -> Maybe a
Just (ByteString -> Alias
Alias ByteString
bs)
| Bool
otherwise = Maybe Alias
forall a. Maybe a
Nothing
{-# INLINE alias #-}
type Timestamp = Word32
newtype FeatureBits = FeatureBits { FeatureBits -> ByteString
getFeatureBits :: ByteString }
deriving (FeatureBits -> FeatureBits -> Bool
(FeatureBits -> FeatureBits -> Bool)
-> (FeatureBits -> FeatureBits -> Bool) -> Eq FeatureBits
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FeatureBits -> FeatureBits -> Bool
== :: FeatureBits -> FeatureBits -> Bool
$c/= :: FeatureBits -> FeatureBits -> Bool
/= :: FeatureBits -> FeatureBits -> Bool
Eq, Int -> FeatureBits -> ShowS
[FeatureBits] -> ShowS
FeatureBits -> String
(Int -> FeatureBits -> ShowS)
-> (FeatureBits -> String)
-> ([FeatureBits] -> ShowS)
-> Show FeatureBits
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FeatureBits -> ShowS
showsPrec :: Int -> FeatureBits -> ShowS
$cshow :: FeatureBits -> String
show :: FeatureBits -> String
$cshowList :: [FeatureBits] -> ShowS
showList :: [FeatureBits] -> ShowS
Show, (forall x. FeatureBits -> Rep FeatureBits x)
-> (forall x. Rep FeatureBits x -> FeatureBits)
-> Generic FeatureBits
forall x. Rep FeatureBits x -> FeatureBits
forall x. FeatureBits -> Rep FeatureBits x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. FeatureBits -> Rep FeatureBits x
from :: forall x. FeatureBits -> Rep FeatureBits x
$cto :: forall x. Rep FeatureBits x -> FeatureBits
to :: forall x. Rep FeatureBits x -> FeatureBits
Generic)
instance NFData FeatureBits
featureBits :: ByteString -> FeatureBits
featureBits :: ByteString -> FeatureBits
featureBits = ByteString -> FeatureBits
FeatureBits
{-# INLINE featureBits #-}
newtype IPv4Addr = IPv4Addr { IPv4Addr -> ByteString
getIPv4Addr :: ByteString }
deriving (IPv4Addr -> IPv4Addr -> Bool
(IPv4Addr -> IPv4Addr -> Bool)
-> (IPv4Addr -> IPv4Addr -> Bool) -> Eq IPv4Addr
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IPv4Addr -> IPv4Addr -> Bool
== :: IPv4Addr -> IPv4Addr -> Bool
$c/= :: IPv4Addr -> IPv4Addr -> Bool
/= :: IPv4Addr -> IPv4Addr -> Bool
Eq, Int -> IPv4Addr -> ShowS
[IPv4Addr] -> ShowS
IPv4Addr -> String
(Int -> IPv4Addr -> ShowS)
-> (IPv4Addr -> String) -> ([IPv4Addr] -> ShowS) -> Show IPv4Addr
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IPv4Addr -> ShowS
showsPrec :: Int -> IPv4Addr -> ShowS
$cshow :: IPv4Addr -> String
show :: IPv4Addr -> String
$cshowList :: [IPv4Addr] -> ShowS
showList :: [IPv4Addr] -> ShowS
Show, (forall x. IPv4Addr -> Rep IPv4Addr x)
-> (forall x. Rep IPv4Addr x -> IPv4Addr) -> Generic IPv4Addr
forall x. Rep IPv4Addr x -> IPv4Addr
forall x. IPv4Addr -> Rep IPv4Addr x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. IPv4Addr -> Rep IPv4Addr x
from :: forall x. IPv4Addr -> Rep IPv4Addr x
$cto :: forall x. Rep IPv4Addr x -> IPv4Addr
to :: forall x. Rep IPv4Addr x -> IPv4Addr
Generic)
instance NFData IPv4Addr
ipv4Addr :: ByteString -> Maybe IPv4Addr
ipv4Addr :: ByteString -> Maybe IPv4Addr
ipv4Addr !ByteString
bs
| ByteString -> Int
BS.length ByteString
bs Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
ipv4AddrLen = IPv4Addr -> Maybe IPv4Addr
forall a. a -> Maybe a
Just (ByteString -> IPv4Addr
IPv4Addr ByteString
bs)
| Bool
otherwise = Maybe IPv4Addr
forall a. Maybe a
Nothing
{-# INLINE ipv4Addr #-}
newtype IPv6Addr = IPv6Addr { IPv6Addr -> ByteString
getIPv6Addr :: ByteString }
deriving (IPv6Addr -> IPv6Addr -> Bool
(IPv6Addr -> IPv6Addr -> Bool)
-> (IPv6Addr -> IPv6Addr -> Bool) -> Eq IPv6Addr
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IPv6Addr -> IPv6Addr -> Bool
== :: IPv6Addr -> IPv6Addr -> Bool
$c/= :: IPv6Addr -> IPv6Addr -> Bool
/= :: IPv6Addr -> IPv6Addr -> Bool
Eq, Int -> IPv6Addr -> ShowS
[IPv6Addr] -> ShowS
IPv6Addr -> String
(Int -> IPv6Addr -> ShowS)
-> (IPv6Addr -> String) -> ([IPv6Addr] -> ShowS) -> Show IPv6Addr
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IPv6Addr -> ShowS
showsPrec :: Int -> IPv6Addr -> ShowS
$cshow :: IPv6Addr -> String
show :: IPv6Addr -> String
$cshowList :: [IPv6Addr] -> ShowS
showList :: [IPv6Addr] -> ShowS
Show, (forall x. IPv6Addr -> Rep IPv6Addr x)
-> (forall x. Rep IPv6Addr x -> IPv6Addr) -> Generic IPv6Addr
forall x. Rep IPv6Addr x -> IPv6Addr
forall x. IPv6Addr -> Rep IPv6Addr x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. IPv6Addr -> Rep IPv6Addr x
from :: forall x. IPv6Addr -> Rep IPv6Addr x
$cto :: forall x. Rep IPv6Addr x -> IPv6Addr
to :: forall x. Rep IPv6Addr x -> IPv6Addr
Generic)
instance NFData IPv6Addr
ipv6Addr :: ByteString -> Maybe IPv6Addr
ipv6Addr :: ByteString -> Maybe IPv6Addr
ipv6Addr !ByteString
bs
| ByteString -> Int
BS.length ByteString
bs Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
ipv6AddrLen = IPv6Addr -> Maybe IPv6Addr
forall a. a -> Maybe a
Just (ByteString -> IPv6Addr
IPv6Addr ByteString
bs)
| Bool
otherwise = Maybe IPv6Addr
forall a. Maybe a
Nothing
{-# INLINE ipv6Addr #-}
newtype TorV3Addr = TorV3Addr { TorV3Addr -> ByteString
getTorV3Addr :: ByteString }
deriving (TorV3Addr -> TorV3Addr -> Bool
(TorV3Addr -> TorV3Addr -> Bool)
-> (TorV3Addr -> TorV3Addr -> Bool) -> Eq TorV3Addr
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TorV3Addr -> TorV3Addr -> Bool
== :: TorV3Addr -> TorV3Addr -> Bool
$c/= :: TorV3Addr -> TorV3Addr -> Bool
/= :: TorV3Addr -> TorV3Addr -> Bool
Eq, Int -> TorV3Addr -> ShowS
[TorV3Addr] -> ShowS
TorV3Addr -> String
(Int -> TorV3Addr -> ShowS)
-> (TorV3Addr -> String)
-> ([TorV3Addr] -> ShowS)
-> Show TorV3Addr
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TorV3Addr -> ShowS
showsPrec :: Int -> TorV3Addr -> ShowS
$cshow :: TorV3Addr -> String
show :: TorV3Addr -> String
$cshowList :: [TorV3Addr] -> ShowS
showList :: [TorV3Addr] -> ShowS
Show, (forall x. TorV3Addr -> Rep TorV3Addr x)
-> (forall x. Rep TorV3Addr x -> TorV3Addr) -> Generic TorV3Addr
forall x. Rep TorV3Addr x -> TorV3Addr
forall x. TorV3Addr -> Rep TorV3Addr x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TorV3Addr -> Rep TorV3Addr x
from :: forall x. TorV3Addr -> Rep TorV3Addr x
$cto :: forall x. Rep TorV3Addr x -> TorV3Addr
to :: forall x. Rep TorV3Addr x -> TorV3Addr
Generic)
instance NFData TorV3Addr
torV3Addr :: ByteString -> Maybe TorV3Addr
torV3Addr :: ByteString -> Maybe TorV3Addr
torV3Addr !ByteString
bs
| ByteString -> Int
BS.length ByteString
bs Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
torV3AddrLen = TorV3Addr -> Maybe TorV3Addr
forall a. a -> Maybe a
Just (ByteString -> TorV3Addr
TorV3Addr ByteString
bs)
| Bool
otherwise = Maybe TorV3Addr
forall a. Maybe a
Nothing
{-# INLINE torV3Addr #-}
data Address
= AddrIPv4 !IPv4Addr !Word16
| AddrIPv6 !IPv6Addr !Word16
| AddrTorV3 !TorV3Addr !Word16
| AddrDNS !ByteString !Word16
deriving (Address -> Address -> Bool
(Address -> Address -> Bool)
-> (Address -> Address -> Bool) -> Eq Address
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Address -> Address -> Bool
== :: Address -> Address -> Bool
$c/= :: Address -> Address -> Bool
/= :: Address -> Address -> Bool
Eq, Int -> Address -> ShowS
[Address] -> ShowS
Address -> String
(Int -> Address -> ShowS)
-> (Address -> String) -> ([Address] -> ShowS) -> Show Address
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Address -> ShowS
showsPrec :: Int -> Address -> ShowS
$cshow :: Address -> String
show :: Address -> String
$cshowList :: [Address] -> ShowS
showList :: [Address] -> ShowS
Show, (forall x. Address -> Rep Address x)
-> (forall x. Rep Address x -> Address) -> Generic Address
forall x. Rep Address x -> Address
forall x. Address -> Rep Address x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Address -> Rep Address x
from :: forall x. Address -> Rep Address x
$cto :: forall x. Rep Address x -> Address
to :: forall x. Rep Address x -> Address
Generic)
instance NFData Address
data MessageFlags = MessageFlags
{ MessageFlags -> Bool
mfHtlcMaxPresent :: !Bool
}
deriving (MessageFlags -> MessageFlags -> Bool
(MessageFlags -> MessageFlags -> Bool)
-> (MessageFlags -> MessageFlags -> Bool) -> Eq MessageFlags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MessageFlags -> MessageFlags -> Bool
== :: MessageFlags -> MessageFlags -> Bool
$c/= :: MessageFlags -> MessageFlags -> Bool
/= :: MessageFlags -> MessageFlags -> Bool
Eq, Int -> MessageFlags -> ShowS
[MessageFlags] -> ShowS
MessageFlags -> String
(Int -> MessageFlags -> ShowS)
-> (MessageFlags -> String)
-> ([MessageFlags] -> ShowS)
-> Show MessageFlags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MessageFlags -> ShowS
showsPrec :: Int -> MessageFlags -> ShowS
$cshow :: MessageFlags -> String
show :: MessageFlags -> String
$cshowList :: [MessageFlags] -> ShowS
showList :: [MessageFlags] -> ShowS
Show, (forall x. MessageFlags -> Rep MessageFlags x)
-> (forall x. Rep MessageFlags x -> MessageFlags)
-> Generic MessageFlags
forall x. Rep MessageFlags x -> MessageFlags
forall x. MessageFlags -> Rep MessageFlags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. MessageFlags -> Rep MessageFlags x
from :: forall x. MessageFlags -> Rep MessageFlags x
$cto :: forall x. Rep MessageFlags x -> MessageFlags
to :: forall x. Rep MessageFlags x -> MessageFlags
Generic)
instance NFData MessageFlags
encodeMessageFlags :: MessageFlags -> Word8
encodeMessageFlags :: MessageFlags -> Word8
encodeMessageFlags MessageFlags
mf = if MessageFlags -> Bool
mfHtlcMaxPresent MessageFlags
mf then Word8
0x01 else Word8
0x00
{-# INLINE encodeMessageFlags #-}
decodeMessageFlags :: Word8 -> MessageFlags
decodeMessageFlags :: Word8 -> MessageFlags
decodeMessageFlags Word8
w = MessageFlags { mfHtlcMaxPresent :: Bool
mfHtlcMaxPresent = Word8
w Word8 -> Word8 -> Word8
forall a. Bits a => a -> a -> a
.&. Word8
0x01 Word8 -> Word8 -> Bool
forall a. Eq a => a -> a -> Bool
/= Word8
0 }
{-# INLINE decodeMessageFlags #-}
data ChannelFlags = ChannelFlags
{ ChannelFlags -> Bool
cfDirection :: !Bool
, ChannelFlags -> Bool
cfDisabled :: !Bool
}
deriving (ChannelFlags -> ChannelFlags -> Bool
(ChannelFlags -> ChannelFlags -> Bool)
-> (ChannelFlags -> ChannelFlags -> Bool) -> Eq ChannelFlags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ChannelFlags -> ChannelFlags -> Bool
== :: ChannelFlags -> ChannelFlags -> Bool
$c/= :: ChannelFlags -> ChannelFlags -> Bool
/= :: ChannelFlags -> ChannelFlags -> Bool
Eq, Int -> ChannelFlags -> ShowS
[ChannelFlags] -> ShowS
ChannelFlags -> String
(Int -> ChannelFlags -> ShowS)
-> (ChannelFlags -> String)
-> ([ChannelFlags] -> ShowS)
-> Show ChannelFlags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ChannelFlags -> ShowS
showsPrec :: Int -> ChannelFlags -> ShowS
$cshow :: ChannelFlags -> String
show :: ChannelFlags -> String
$cshowList :: [ChannelFlags] -> ShowS
showList :: [ChannelFlags] -> ShowS
Show, (forall x. ChannelFlags -> Rep ChannelFlags x)
-> (forall x. Rep ChannelFlags x -> ChannelFlags)
-> Generic ChannelFlags
forall x. Rep ChannelFlags x -> ChannelFlags
forall x. ChannelFlags -> Rep ChannelFlags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ChannelFlags -> Rep ChannelFlags x
from :: forall x. ChannelFlags -> Rep ChannelFlags x
$cto :: forall x. Rep ChannelFlags x -> ChannelFlags
to :: forall x. Rep ChannelFlags x -> ChannelFlags
Generic)
instance NFData ChannelFlags
encodeChannelFlags :: ChannelFlags -> Word8
encodeChannelFlags :: ChannelFlags -> Word8
encodeChannelFlags ChannelFlags
cf =
(if ChannelFlags -> Bool
cfDirection ChannelFlags
cf then Word8
0x01 else Word8
0x00) Word8 -> Word8 -> Word8
forall a. Bits a => a -> a -> a
.|.
(if ChannelFlags -> Bool
cfDisabled ChannelFlags
cf then Word8
0x02 else Word8
0x00)
{-# INLINE encodeChannelFlags #-}
decodeChannelFlags :: Word8 -> ChannelFlags
decodeChannelFlags :: Word8 -> ChannelFlags
decodeChannelFlags Word8
w = ChannelFlags
{ cfDirection :: Bool
cfDirection = Word8
w Word8 -> Word8 -> Word8
forall a. Bits a => a -> a -> a
.&. Word8
0x01 Word8 -> Word8 -> Bool
forall a. Eq a => a -> a -> Bool
/= Word8
0
, cfDisabled :: Bool
cfDisabled = Word8
w Word8 -> Word8 -> Word8
forall a. Bits a => a -> a -> a
.&. Word8
0x02 Word8 -> Word8 -> Bool
forall a. Eq a => a -> a -> Bool
/= Word8
0
}
{-# INLINE decodeChannelFlags #-}
newtype CltvExpiryDelta = CltvExpiryDelta { CltvExpiryDelta -> Word16
getCltvExpiryDelta :: Word16 }
deriving (CltvExpiryDelta -> CltvExpiryDelta -> Bool
(CltvExpiryDelta -> CltvExpiryDelta -> Bool)
-> (CltvExpiryDelta -> CltvExpiryDelta -> Bool)
-> Eq CltvExpiryDelta
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CltvExpiryDelta -> CltvExpiryDelta -> Bool
== :: CltvExpiryDelta -> CltvExpiryDelta -> Bool
$c/= :: CltvExpiryDelta -> CltvExpiryDelta -> Bool
/= :: CltvExpiryDelta -> CltvExpiryDelta -> Bool
Eq, Eq CltvExpiryDelta
Eq CltvExpiryDelta =>
(CltvExpiryDelta -> CltvExpiryDelta -> Ordering)
-> (CltvExpiryDelta -> CltvExpiryDelta -> Bool)
-> (CltvExpiryDelta -> CltvExpiryDelta -> Bool)
-> (CltvExpiryDelta -> CltvExpiryDelta -> Bool)
-> (CltvExpiryDelta -> CltvExpiryDelta -> Bool)
-> (CltvExpiryDelta -> CltvExpiryDelta -> CltvExpiryDelta)
-> (CltvExpiryDelta -> CltvExpiryDelta -> CltvExpiryDelta)
-> Ord CltvExpiryDelta
CltvExpiryDelta -> CltvExpiryDelta -> Bool
CltvExpiryDelta -> CltvExpiryDelta -> Ordering
CltvExpiryDelta -> CltvExpiryDelta -> CltvExpiryDelta
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: CltvExpiryDelta -> CltvExpiryDelta -> Ordering
compare :: CltvExpiryDelta -> CltvExpiryDelta -> Ordering
$c< :: CltvExpiryDelta -> CltvExpiryDelta -> Bool
< :: CltvExpiryDelta -> CltvExpiryDelta -> Bool
$c<= :: CltvExpiryDelta -> CltvExpiryDelta -> Bool
<= :: CltvExpiryDelta -> CltvExpiryDelta -> Bool
$c> :: CltvExpiryDelta -> CltvExpiryDelta -> Bool
> :: CltvExpiryDelta -> CltvExpiryDelta -> Bool
$c>= :: CltvExpiryDelta -> CltvExpiryDelta -> Bool
>= :: CltvExpiryDelta -> CltvExpiryDelta -> Bool
$cmax :: CltvExpiryDelta -> CltvExpiryDelta -> CltvExpiryDelta
max :: CltvExpiryDelta -> CltvExpiryDelta -> CltvExpiryDelta
$cmin :: CltvExpiryDelta -> CltvExpiryDelta -> CltvExpiryDelta
min :: CltvExpiryDelta -> CltvExpiryDelta -> CltvExpiryDelta
Ord, Int -> CltvExpiryDelta -> ShowS
[CltvExpiryDelta] -> ShowS
CltvExpiryDelta -> String
(Int -> CltvExpiryDelta -> ShowS)
-> (CltvExpiryDelta -> String)
-> ([CltvExpiryDelta] -> ShowS)
-> Show CltvExpiryDelta
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CltvExpiryDelta -> ShowS
showsPrec :: Int -> CltvExpiryDelta -> ShowS
$cshow :: CltvExpiryDelta -> String
show :: CltvExpiryDelta -> String
$cshowList :: [CltvExpiryDelta] -> ShowS
showList :: [CltvExpiryDelta] -> ShowS
Show, (forall x. CltvExpiryDelta -> Rep CltvExpiryDelta x)
-> (forall x. Rep CltvExpiryDelta x -> CltvExpiryDelta)
-> Generic CltvExpiryDelta
forall x. Rep CltvExpiryDelta x -> CltvExpiryDelta
forall x. CltvExpiryDelta -> Rep CltvExpiryDelta x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. CltvExpiryDelta -> Rep CltvExpiryDelta x
from :: forall x. CltvExpiryDelta -> Rep CltvExpiryDelta x
$cto :: forall x. Rep CltvExpiryDelta x -> CltvExpiryDelta
to :: forall x. Rep CltvExpiryDelta x -> CltvExpiryDelta
Generic)
instance NFData CltvExpiryDelta
newtype FeeBaseMsat = FeeBaseMsat { FeeBaseMsat -> Word32
getFeeBaseMsat :: Word32 }
deriving (FeeBaseMsat -> FeeBaseMsat -> Bool
(FeeBaseMsat -> FeeBaseMsat -> Bool)
-> (FeeBaseMsat -> FeeBaseMsat -> Bool) -> Eq FeeBaseMsat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FeeBaseMsat -> FeeBaseMsat -> Bool
== :: FeeBaseMsat -> FeeBaseMsat -> Bool
$c/= :: FeeBaseMsat -> FeeBaseMsat -> Bool
/= :: FeeBaseMsat -> FeeBaseMsat -> Bool
Eq, Eq FeeBaseMsat
Eq FeeBaseMsat =>
(FeeBaseMsat -> FeeBaseMsat -> Ordering)
-> (FeeBaseMsat -> FeeBaseMsat -> Bool)
-> (FeeBaseMsat -> FeeBaseMsat -> Bool)
-> (FeeBaseMsat -> FeeBaseMsat -> Bool)
-> (FeeBaseMsat -> FeeBaseMsat -> Bool)
-> (FeeBaseMsat -> FeeBaseMsat -> FeeBaseMsat)
-> (FeeBaseMsat -> FeeBaseMsat -> FeeBaseMsat)
-> Ord FeeBaseMsat
FeeBaseMsat -> FeeBaseMsat -> Bool
FeeBaseMsat -> FeeBaseMsat -> Ordering
FeeBaseMsat -> FeeBaseMsat -> FeeBaseMsat
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: FeeBaseMsat -> FeeBaseMsat -> Ordering
compare :: FeeBaseMsat -> FeeBaseMsat -> Ordering
$c< :: FeeBaseMsat -> FeeBaseMsat -> Bool
< :: FeeBaseMsat -> FeeBaseMsat -> Bool
$c<= :: FeeBaseMsat -> FeeBaseMsat -> Bool
<= :: FeeBaseMsat -> FeeBaseMsat -> Bool
$c> :: FeeBaseMsat -> FeeBaseMsat -> Bool
> :: FeeBaseMsat -> FeeBaseMsat -> Bool
$c>= :: FeeBaseMsat -> FeeBaseMsat -> Bool
>= :: FeeBaseMsat -> FeeBaseMsat -> Bool
$cmax :: FeeBaseMsat -> FeeBaseMsat -> FeeBaseMsat
max :: FeeBaseMsat -> FeeBaseMsat -> FeeBaseMsat
$cmin :: FeeBaseMsat -> FeeBaseMsat -> FeeBaseMsat
min :: FeeBaseMsat -> FeeBaseMsat -> FeeBaseMsat
Ord, Int -> FeeBaseMsat -> ShowS
[FeeBaseMsat] -> ShowS
FeeBaseMsat -> String
(Int -> FeeBaseMsat -> ShowS)
-> (FeeBaseMsat -> String)
-> ([FeeBaseMsat] -> ShowS)
-> Show FeeBaseMsat
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FeeBaseMsat -> ShowS
showsPrec :: Int -> FeeBaseMsat -> ShowS
$cshow :: FeeBaseMsat -> String
show :: FeeBaseMsat -> String
$cshowList :: [FeeBaseMsat] -> ShowS
showList :: [FeeBaseMsat] -> ShowS
Show, (forall x. FeeBaseMsat -> Rep FeeBaseMsat x)
-> (forall x. Rep FeeBaseMsat x -> FeeBaseMsat)
-> Generic FeeBaseMsat
forall x. Rep FeeBaseMsat x -> FeeBaseMsat
forall x. FeeBaseMsat -> Rep FeeBaseMsat x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. FeeBaseMsat -> Rep FeeBaseMsat x
from :: forall x. FeeBaseMsat -> Rep FeeBaseMsat x
$cto :: forall x. Rep FeeBaseMsat x -> FeeBaseMsat
to :: forall x. Rep FeeBaseMsat x -> FeeBaseMsat
Generic)
instance NFData FeeBaseMsat
newtype FeeProportionalMillionths = FeeProportionalMillionths
{ FeeProportionalMillionths -> Word32
getFeeProportionalMillionths :: Word32 }
deriving (FeeProportionalMillionths -> FeeProportionalMillionths -> Bool
(FeeProportionalMillionths -> FeeProportionalMillionths -> Bool)
-> (FeeProportionalMillionths -> FeeProportionalMillionths -> Bool)
-> Eq FeeProportionalMillionths
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FeeProportionalMillionths -> FeeProportionalMillionths -> Bool
== :: FeeProportionalMillionths -> FeeProportionalMillionths -> Bool
$c/= :: FeeProportionalMillionths -> FeeProportionalMillionths -> Bool
/= :: FeeProportionalMillionths -> FeeProportionalMillionths -> Bool
Eq, Eq FeeProportionalMillionths
Eq FeeProportionalMillionths =>
(FeeProportionalMillionths
-> FeeProportionalMillionths -> Ordering)
-> (FeeProportionalMillionths -> FeeProportionalMillionths -> Bool)
-> (FeeProportionalMillionths -> FeeProportionalMillionths -> Bool)
-> (FeeProportionalMillionths -> FeeProportionalMillionths -> Bool)
-> (FeeProportionalMillionths -> FeeProportionalMillionths -> Bool)
-> (FeeProportionalMillionths
-> FeeProportionalMillionths -> FeeProportionalMillionths)
-> (FeeProportionalMillionths
-> FeeProportionalMillionths -> FeeProportionalMillionths)
-> Ord FeeProportionalMillionths
FeeProportionalMillionths -> FeeProportionalMillionths -> Bool
FeeProportionalMillionths -> FeeProportionalMillionths -> Ordering
FeeProportionalMillionths
-> FeeProportionalMillionths -> FeeProportionalMillionths
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: FeeProportionalMillionths -> FeeProportionalMillionths -> Ordering
compare :: FeeProportionalMillionths -> FeeProportionalMillionths -> Ordering
$c< :: FeeProportionalMillionths -> FeeProportionalMillionths -> Bool
< :: FeeProportionalMillionths -> FeeProportionalMillionths -> Bool
$c<= :: FeeProportionalMillionths -> FeeProportionalMillionths -> Bool
<= :: FeeProportionalMillionths -> FeeProportionalMillionths -> Bool
$c> :: FeeProportionalMillionths -> FeeProportionalMillionths -> Bool
> :: FeeProportionalMillionths -> FeeProportionalMillionths -> Bool
$c>= :: FeeProportionalMillionths -> FeeProportionalMillionths -> Bool
>= :: FeeProportionalMillionths -> FeeProportionalMillionths -> Bool
$cmax :: FeeProportionalMillionths
-> FeeProportionalMillionths -> FeeProportionalMillionths
max :: FeeProportionalMillionths
-> FeeProportionalMillionths -> FeeProportionalMillionths
$cmin :: FeeProportionalMillionths
-> FeeProportionalMillionths -> FeeProportionalMillionths
min :: FeeProportionalMillionths
-> FeeProportionalMillionths -> FeeProportionalMillionths
Ord, Int -> FeeProportionalMillionths -> ShowS
[FeeProportionalMillionths] -> ShowS
FeeProportionalMillionths -> String
(Int -> FeeProportionalMillionths -> ShowS)
-> (FeeProportionalMillionths -> String)
-> ([FeeProportionalMillionths] -> ShowS)
-> Show FeeProportionalMillionths
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FeeProportionalMillionths -> ShowS
showsPrec :: Int -> FeeProportionalMillionths -> ShowS
$cshow :: FeeProportionalMillionths -> String
show :: FeeProportionalMillionths -> String
$cshowList :: [FeeProportionalMillionths] -> ShowS
showList :: [FeeProportionalMillionths] -> ShowS
Show, (forall x.
FeeProportionalMillionths -> Rep FeeProportionalMillionths x)
-> (forall x.
Rep FeeProportionalMillionths x -> FeeProportionalMillionths)
-> Generic FeeProportionalMillionths
forall x.
Rep FeeProportionalMillionths x -> FeeProportionalMillionths
forall x.
FeeProportionalMillionths -> Rep FeeProportionalMillionths x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
FeeProportionalMillionths -> Rep FeeProportionalMillionths x
from :: forall x.
FeeProportionalMillionths -> Rep FeeProportionalMillionths x
$cto :: forall x.
Rep FeeProportionalMillionths x -> FeeProportionalMillionths
to :: forall x.
Rep FeeProportionalMillionths x -> FeeProportionalMillionths
Generic)
instance NFData FeeProportionalMillionths
newtype HtlcMinimumMsat = HtlcMinimumMsat { HtlcMinimumMsat -> Word64
getHtlcMinimumMsat :: Word64 }
deriving (HtlcMinimumMsat -> HtlcMinimumMsat -> Bool
(HtlcMinimumMsat -> HtlcMinimumMsat -> Bool)
-> (HtlcMinimumMsat -> HtlcMinimumMsat -> Bool)
-> Eq HtlcMinimumMsat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: HtlcMinimumMsat -> HtlcMinimumMsat -> Bool
== :: HtlcMinimumMsat -> HtlcMinimumMsat -> Bool
$c/= :: HtlcMinimumMsat -> HtlcMinimumMsat -> Bool
/= :: HtlcMinimumMsat -> HtlcMinimumMsat -> Bool
Eq, Eq HtlcMinimumMsat
Eq HtlcMinimumMsat =>
(HtlcMinimumMsat -> HtlcMinimumMsat -> Ordering)
-> (HtlcMinimumMsat -> HtlcMinimumMsat -> Bool)
-> (HtlcMinimumMsat -> HtlcMinimumMsat -> Bool)
-> (HtlcMinimumMsat -> HtlcMinimumMsat -> Bool)
-> (HtlcMinimumMsat -> HtlcMinimumMsat -> Bool)
-> (HtlcMinimumMsat -> HtlcMinimumMsat -> HtlcMinimumMsat)
-> (HtlcMinimumMsat -> HtlcMinimumMsat -> HtlcMinimumMsat)
-> Ord HtlcMinimumMsat
HtlcMinimumMsat -> HtlcMinimumMsat -> Bool
HtlcMinimumMsat -> HtlcMinimumMsat -> Ordering
HtlcMinimumMsat -> HtlcMinimumMsat -> HtlcMinimumMsat
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: HtlcMinimumMsat -> HtlcMinimumMsat -> Ordering
compare :: HtlcMinimumMsat -> HtlcMinimumMsat -> Ordering
$c< :: HtlcMinimumMsat -> HtlcMinimumMsat -> Bool
< :: HtlcMinimumMsat -> HtlcMinimumMsat -> Bool
$c<= :: HtlcMinimumMsat -> HtlcMinimumMsat -> Bool
<= :: HtlcMinimumMsat -> HtlcMinimumMsat -> Bool
$c> :: HtlcMinimumMsat -> HtlcMinimumMsat -> Bool
> :: HtlcMinimumMsat -> HtlcMinimumMsat -> Bool
$c>= :: HtlcMinimumMsat -> HtlcMinimumMsat -> Bool
>= :: HtlcMinimumMsat -> HtlcMinimumMsat -> Bool
$cmax :: HtlcMinimumMsat -> HtlcMinimumMsat -> HtlcMinimumMsat
max :: HtlcMinimumMsat -> HtlcMinimumMsat -> HtlcMinimumMsat
$cmin :: HtlcMinimumMsat -> HtlcMinimumMsat -> HtlcMinimumMsat
min :: HtlcMinimumMsat -> HtlcMinimumMsat -> HtlcMinimumMsat
Ord, Int -> HtlcMinimumMsat -> ShowS
[HtlcMinimumMsat] -> ShowS
HtlcMinimumMsat -> String
(Int -> HtlcMinimumMsat -> ShowS)
-> (HtlcMinimumMsat -> String)
-> ([HtlcMinimumMsat] -> ShowS)
-> Show HtlcMinimumMsat
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> HtlcMinimumMsat -> ShowS
showsPrec :: Int -> HtlcMinimumMsat -> ShowS
$cshow :: HtlcMinimumMsat -> String
show :: HtlcMinimumMsat -> String
$cshowList :: [HtlcMinimumMsat] -> ShowS
showList :: [HtlcMinimumMsat] -> ShowS
Show, (forall x. HtlcMinimumMsat -> Rep HtlcMinimumMsat x)
-> (forall x. Rep HtlcMinimumMsat x -> HtlcMinimumMsat)
-> Generic HtlcMinimumMsat
forall x. Rep HtlcMinimumMsat x -> HtlcMinimumMsat
forall x. HtlcMinimumMsat -> Rep HtlcMinimumMsat x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. HtlcMinimumMsat -> Rep HtlcMinimumMsat x
from :: forall x. HtlcMinimumMsat -> Rep HtlcMinimumMsat x
$cto :: forall x. Rep HtlcMinimumMsat x -> HtlcMinimumMsat
to :: forall x. Rep HtlcMinimumMsat x -> HtlcMinimumMsat
Generic)
instance NFData HtlcMinimumMsat
newtype HtlcMaximumMsat = HtlcMaximumMsat { HtlcMaximumMsat -> Word64
getHtlcMaximumMsat :: Word64 }
deriving (HtlcMaximumMsat -> HtlcMaximumMsat -> Bool
(HtlcMaximumMsat -> HtlcMaximumMsat -> Bool)
-> (HtlcMaximumMsat -> HtlcMaximumMsat -> Bool)
-> Eq HtlcMaximumMsat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: HtlcMaximumMsat -> HtlcMaximumMsat -> Bool
== :: HtlcMaximumMsat -> HtlcMaximumMsat -> Bool
$c/= :: HtlcMaximumMsat -> HtlcMaximumMsat -> Bool
/= :: HtlcMaximumMsat -> HtlcMaximumMsat -> Bool
Eq, Eq HtlcMaximumMsat
Eq HtlcMaximumMsat =>
(HtlcMaximumMsat -> HtlcMaximumMsat -> Ordering)
-> (HtlcMaximumMsat -> HtlcMaximumMsat -> Bool)
-> (HtlcMaximumMsat -> HtlcMaximumMsat -> Bool)
-> (HtlcMaximumMsat -> HtlcMaximumMsat -> Bool)
-> (HtlcMaximumMsat -> HtlcMaximumMsat -> Bool)
-> (HtlcMaximumMsat -> HtlcMaximumMsat -> HtlcMaximumMsat)
-> (HtlcMaximumMsat -> HtlcMaximumMsat -> HtlcMaximumMsat)
-> Ord HtlcMaximumMsat
HtlcMaximumMsat -> HtlcMaximumMsat -> Bool
HtlcMaximumMsat -> HtlcMaximumMsat -> Ordering
HtlcMaximumMsat -> HtlcMaximumMsat -> HtlcMaximumMsat
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: HtlcMaximumMsat -> HtlcMaximumMsat -> Ordering
compare :: HtlcMaximumMsat -> HtlcMaximumMsat -> Ordering
$c< :: HtlcMaximumMsat -> HtlcMaximumMsat -> Bool
< :: HtlcMaximumMsat -> HtlcMaximumMsat -> Bool
$c<= :: HtlcMaximumMsat -> HtlcMaximumMsat -> Bool
<= :: HtlcMaximumMsat -> HtlcMaximumMsat -> Bool
$c> :: HtlcMaximumMsat -> HtlcMaximumMsat -> Bool
> :: HtlcMaximumMsat -> HtlcMaximumMsat -> Bool
$c>= :: HtlcMaximumMsat -> HtlcMaximumMsat -> Bool
>= :: HtlcMaximumMsat -> HtlcMaximumMsat -> Bool
$cmax :: HtlcMaximumMsat -> HtlcMaximumMsat -> HtlcMaximumMsat
max :: HtlcMaximumMsat -> HtlcMaximumMsat -> HtlcMaximumMsat
$cmin :: HtlcMaximumMsat -> HtlcMaximumMsat -> HtlcMaximumMsat
min :: HtlcMaximumMsat -> HtlcMaximumMsat -> HtlcMaximumMsat
Ord, Int -> HtlcMaximumMsat -> ShowS
[HtlcMaximumMsat] -> ShowS
HtlcMaximumMsat -> String
(Int -> HtlcMaximumMsat -> ShowS)
-> (HtlcMaximumMsat -> String)
-> ([HtlcMaximumMsat] -> ShowS)
-> Show HtlcMaximumMsat
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> HtlcMaximumMsat -> ShowS
showsPrec :: Int -> HtlcMaximumMsat -> ShowS
$cshow :: HtlcMaximumMsat -> String
show :: HtlcMaximumMsat -> String
$cshowList :: [HtlcMaximumMsat] -> ShowS
showList :: [HtlcMaximumMsat] -> ShowS
Show, (forall x. HtlcMaximumMsat -> Rep HtlcMaximumMsat x)
-> (forall x. Rep HtlcMaximumMsat x -> HtlcMaximumMsat)
-> Generic HtlcMaximumMsat
forall x. Rep HtlcMaximumMsat x -> HtlcMaximumMsat
forall x. HtlcMaximumMsat -> Rep HtlcMaximumMsat x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. HtlcMaximumMsat -> Rep HtlcMaximumMsat x
from :: forall x. HtlcMaximumMsat -> Rep HtlcMaximumMsat x
$cto :: forall x. Rep HtlcMaximumMsat x -> HtlcMaximumMsat
to :: forall x. Rep HtlcMaximumMsat x -> HtlcMaximumMsat
Generic)
instance NFData HtlcMaximumMsat