{-# OPTIONS_HADDOCK prune #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveGeneric #-}
module Lightning.Protocol.BOLT7.Types (
ChainHash(..)
, chainHash
, unChainHash
, mainnetChainHash
, ShortChannelId(..)
, shortChannelId
, scidBlockHeight
, scidTxIndex
, scidOutputIndex
, scidWord64
, scidFromBytes
, scidToBytes
, formatScid
, ChannelId(..)
, channelId
, unChannelId
, Signature(..)
, signature
, unSignature
, Point(..)
, point
, unPoint
, 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)
import Lightning.Protocol.BOLT1.Prim
( ChainHash(..), unChainHash, chainHash
, ShortChannelId(..), shortChannelId
, scidBlockHeight, scidTxIndex, scidOutputIndex, scidWord64
, ChannelId(..), unChannelId, channelId
, Signature(..), unSignature, signature
, Point(..), unPoint, point
)
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 #-}
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
]
scidFromBytes :: ByteString -> Maybe ShortChannelId
scidFromBytes :: ByteString -> Maybe ShortChannelId
scidFromBytes !ByteString
bs
| ByteString -> Int
BS.length ByteString
bs Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
/= Int
shortChannelIdLen = Maybe ShortChannelId
forall a. Maybe a
Nothing
| Bool
otherwise =
let !w :: Word64
w = (Word8 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral (HasCallStack => ByteString -> Int -> Word8
ByteString -> Int -> Word8
BS.index ByteString
bs Int
0) Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
`shiftL` Int
56)
Word64 -> Word64 -> Word64
forall a. Bits a => a -> a -> a
.|. (Word8 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral (HasCallStack => ByteString -> Int -> Word8
ByteString -> Int -> Word8
BS.index ByteString
bs Int
1) Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
`shiftL` Int
48)
Word64 -> Word64 -> Word64
forall a. Bits a => a -> a -> a
.|. (Word8 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral (HasCallStack => ByteString -> Int -> Word8
ByteString -> Int -> Word8
BS.index ByteString
bs Int
2) Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
`shiftL` Int
40)
Word64 -> Word64 -> Word64
forall a. Bits a => a -> a -> a
.|. (Word8 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral (HasCallStack => ByteString -> Int -> Word8
ByteString -> Int -> Word8
BS.index ByteString
bs Int
3) Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
`shiftL` Int
32)
Word64 -> Word64 -> Word64
forall a. Bits a => a -> a -> a
.|. (Word8 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral (HasCallStack => ByteString -> Int -> Word8
ByteString -> Int -> Word8
BS.index ByteString
bs Int
4) Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
`shiftL` Int
24)
Word64 -> Word64 -> Word64
forall a. Bits a => a -> a -> a
.|. (Word8 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral (HasCallStack => ByteString -> Int -> Word8
ByteString -> Int -> Word8
BS.index ByteString
bs Int
5) Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
`shiftL` Int
16)
Word64 -> Word64 -> Word64
forall a. Bits a => a -> a -> a
.|. (Word8 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral (HasCallStack => ByteString -> Int -> Word8
ByteString -> Int -> Word8
BS.index ByteString
bs Int
6) Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
`shiftL` Int
8)
Word64 -> Word64 -> Word64
forall a. Bits a => a -> a -> a
.|. Word8 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral (HasCallStack => ByteString -> Int -> Word8
ByteString -> Int -> Word8
BS.index ByteString
bs Int
7) :: Word64
in ShortChannelId -> Maybe ShortChannelId
forall a. a -> Maybe a
Just (Word64 -> ShortChannelId
ShortChannelId Word64
w)
{-# INLINE scidFromBytes #-}
scidToBytes :: ShortChannelId -> ByteString
scidToBytes :: ShortChannelId -> ByteString
scidToBytes !ShortChannelId
sci =
let !w :: Word64
w = ShortChannelId -> Word64
scidWord64 ShortChannelId
sci
in [Word8] -> ByteString
BS.pack
[ Word64 -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word64
w Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
`shiftR` Int
56)
, Word64 -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word64
w Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
`shiftR` Int
48)
, Word64 -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word64
w Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
`shiftR` Int
40)
, Word64 -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word64
w Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
`shiftR` Int
32)
, Word64 -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word64
w Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
`shiftR` Int
24)
, Word64 -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word64
w Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
`shiftR` Int
16)
, Word64 -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word64
w Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
`shiftR` Int
8)
, Word64 -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word64
w
]
{-# INLINE scidToBytes #-}
formatScid :: ShortChannelId -> String
formatScid :: ShortChannelId -> String
formatScid ShortChannelId
sci =
Word32 -> String
forall a. Show a => a -> String
show (ShortChannelId -> Word32
scidBlockHeight ShortChannelId
sci) String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"x" String -> String -> String
forall a. [a] -> [a] -> [a]
++
Word32 -> String
forall a. Show a => a -> String
show (ShortChannelId -> Word32
scidTxIndex ShortChannelId
sci) String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"x" String -> String -> String
forall a. [a] -> [a] -> [a]
++
Word16 -> String
forall a. Show a => a -> String
show (ShortChannelId -> Word16
scidOutputIndex ShortChannelId
sci)
{-# INLINE formatScid #-}
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 -> String -> String
[NodeId] -> String -> String
NodeId -> String
(Int -> NodeId -> String -> String)
-> (NodeId -> String)
-> ([NodeId] -> String -> String)
-> Show NodeId
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> NodeId -> String -> String
showsPrec :: Int -> NodeId -> String -> String
$cshow :: NodeId -> String
show :: NodeId -> String
$cshowList :: [NodeId] -> String -> String
showList :: [NodeId] -> String -> String
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 -> String -> String
[RgbColor] -> String -> String
RgbColor -> String
(Int -> RgbColor -> String -> String)
-> (RgbColor -> String)
-> ([RgbColor] -> String -> String)
-> Show RgbColor
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> RgbColor -> String -> String
showsPrec :: Int -> RgbColor -> String -> String
$cshow :: RgbColor -> String
show :: RgbColor -> String
$cshowList :: [RgbColor] -> String -> String
showList :: [RgbColor] -> String -> String
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 -> String -> String
[Alias] -> String -> String
Alias -> String
(Int -> Alias -> String -> String)
-> (Alias -> String) -> ([Alias] -> String -> String) -> Show Alias
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> Alias -> String -> String
showsPrec :: Int -> Alias -> String -> String
$cshow :: Alias -> String
show :: Alias -> String
$cshowList :: [Alias] -> String -> String
showList :: [Alias] -> String -> String
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 -> String -> String
[FeatureBits] -> String -> String
FeatureBits -> String
(Int -> FeatureBits -> String -> String)
-> (FeatureBits -> String)
-> ([FeatureBits] -> String -> String)
-> Show FeatureBits
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> FeatureBits -> String -> String
showsPrec :: Int -> FeatureBits -> String -> String
$cshow :: FeatureBits -> String
show :: FeatureBits -> String
$cshowList :: [FeatureBits] -> String -> String
showList :: [FeatureBits] -> String -> String
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 -> String -> String
[IPv4Addr] -> String -> String
IPv4Addr -> String
(Int -> IPv4Addr -> String -> String)
-> (IPv4Addr -> String)
-> ([IPv4Addr] -> String -> String)
-> Show IPv4Addr
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> IPv4Addr -> String -> String
showsPrec :: Int -> IPv4Addr -> String -> String
$cshow :: IPv4Addr -> String
show :: IPv4Addr -> String
$cshowList :: [IPv4Addr] -> String -> String
showList :: [IPv4Addr] -> String -> String
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 -> String -> String
[IPv6Addr] -> String -> String
IPv6Addr -> String
(Int -> IPv6Addr -> String -> String)
-> (IPv6Addr -> String)
-> ([IPv6Addr] -> String -> String)
-> Show IPv6Addr
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> IPv6Addr -> String -> String
showsPrec :: Int -> IPv6Addr -> String -> String
$cshow :: IPv6Addr -> String
show :: IPv6Addr -> String
$cshowList :: [IPv6Addr] -> String -> String
showList :: [IPv6Addr] -> String -> String
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 -> String -> String
[TorV3Addr] -> String -> String
TorV3Addr -> String
(Int -> TorV3Addr -> String -> String)
-> (TorV3Addr -> String)
-> ([TorV3Addr] -> String -> String)
-> Show TorV3Addr
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> TorV3Addr -> String -> String
showsPrec :: Int -> TorV3Addr -> String -> String
$cshow :: TorV3Addr -> String
show :: TorV3Addr -> String
$cshowList :: [TorV3Addr] -> String -> String
showList :: [TorV3Addr] -> String -> String
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 -> String -> String
[Address] -> String -> String
Address -> String
(Int -> Address -> String -> String)
-> (Address -> String)
-> ([Address] -> String -> String)
-> Show Address
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> Address -> String -> String
showsPrec :: Int -> Address -> String -> String
$cshow :: Address -> String
show :: Address -> String
$cshowList :: [Address] -> String -> String
showList :: [Address] -> String -> String
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 -> String -> String
[MessageFlags] -> String -> String
MessageFlags -> String
(Int -> MessageFlags -> String -> String)
-> (MessageFlags -> String)
-> ([MessageFlags] -> String -> String)
-> Show MessageFlags
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> MessageFlags -> String -> String
showsPrec :: Int -> MessageFlags -> String -> String
$cshow :: MessageFlags -> String
show :: MessageFlags -> String
$cshowList :: [MessageFlags] -> String -> String
showList :: [MessageFlags] -> String -> String
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 -> String -> String
[ChannelFlags] -> String -> String
ChannelFlags -> String
(Int -> ChannelFlags -> String -> String)
-> (ChannelFlags -> String)
-> ([ChannelFlags] -> String -> String)
-> Show ChannelFlags
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> ChannelFlags -> String -> String
showsPrec :: Int -> ChannelFlags -> String -> String
$cshow :: ChannelFlags -> String
show :: ChannelFlags -> String
$cshowList :: [ChannelFlags] -> String -> String
showList :: [ChannelFlags] -> String -> String
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 -> String -> String
[CltvExpiryDelta] -> String -> String
CltvExpiryDelta -> String
(Int -> CltvExpiryDelta -> String -> String)
-> (CltvExpiryDelta -> String)
-> ([CltvExpiryDelta] -> String -> String)
-> Show CltvExpiryDelta
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> CltvExpiryDelta -> String -> String
showsPrec :: Int -> CltvExpiryDelta -> String -> String
$cshow :: CltvExpiryDelta -> String
show :: CltvExpiryDelta -> String
$cshowList :: [CltvExpiryDelta] -> String -> String
showList :: [CltvExpiryDelta] -> String -> String
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 -> String -> String
[FeeBaseMsat] -> String -> String
FeeBaseMsat -> String
(Int -> FeeBaseMsat -> String -> String)
-> (FeeBaseMsat -> String)
-> ([FeeBaseMsat] -> String -> String)
-> Show FeeBaseMsat
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> FeeBaseMsat -> String -> String
showsPrec :: Int -> FeeBaseMsat -> String -> String
$cshow :: FeeBaseMsat -> String
show :: FeeBaseMsat -> String
$cshowList :: [FeeBaseMsat] -> String -> String
showList :: [FeeBaseMsat] -> String -> String
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 -> String -> String
[FeeProportionalMillionths] -> String -> String
FeeProportionalMillionths -> String
(Int -> FeeProportionalMillionths -> String -> String)
-> (FeeProportionalMillionths -> String)
-> ([FeeProportionalMillionths] -> String -> String)
-> Show FeeProportionalMillionths
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> FeeProportionalMillionths -> String -> String
showsPrec :: Int -> FeeProportionalMillionths -> String -> String
$cshow :: FeeProportionalMillionths -> String
show :: FeeProportionalMillionths -> String
$cshowList :: [FeeProportionalMillionths] -> String -> String
showList :: [FeeProportionalMillionths] -> String -> String
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 -> String -> String
[HtlcMinimumMsat] -> String -> String
HtlcMinimumMsat -> String
(Int -> HtlcMinimumMsat -> String -> String)
-> (HtlcMinimumMsat -> String)
-> ([HtlcMinimumMsat] -> String -> String)
-> Show HtlcMinimumMsat
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> HtlcMinimumMsat -> String -> String
showsPrec :: Int -> HtlcMinimumMsat -> String -> String
$cshow :: HtlcMinimumMsat -> String
show :: HtlcMinimumMsat -> String
$cshowList :: [HtlcMinimumMsat] -> String -> String
showList :: [HtlcMinimumMsat] -> String -> String
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 -> String -> String
[HtlcMaximumMsat] -> String -> String
HtlcMaximumMsat -> String
(Int -> HtlcMaximumMsat -> String -> String)
-> (HtlcMaximumMsat -> String)
-> ([HtlcMaximumMsat] -> String -> String)
-> Show HtlcMaximumMsat
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> HtlcMaximumMsat -> String -> String
showsPrec :: Int -> HtlcMaximumMsat -> String -> String
$cshow :: HtlcMaximumMsat -> String
show :: HtlcMaximumMsat -> String
$cshowList :: [HtlcMaximumMsat] -> String -> String
showList :: [HtlcMaximumMsat] -> String -> String
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