| Copyright | (c) 2025 Jared Tobin |
|---|---|
| License | MIT |
| Maintainer | Jared Tobin <jared@ppad.tech> |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Lightning.Protocol.BOLT9.Features
Description
Known feature table for the Lightning Network, per BOLT #9.
Synopsis
- data Feature = Feature {
- featureName :: !String
- featureBaseBit :: !Word16
- featureContexts :: ![Context]
- featureDependencies :: ![String]
- featureAssumed :: !Bool
- featureByBit :: Word16 -> Maybe Feature
- featureByName :: String -> Maybe Feature
- knownFeatures :: [Feature]
Feature
A known feature from the BOLT #9 specification.
Constructors
| Feature | |
Fields
| |
Instances
Lookup
featureByBit :: Word16 -> Maybe Feature Source #
Look up a feature by bit number.
Accepts either the even (compulsory) or odd (optional) bit of the pair.
>>>fmap featureName (featureByBit 16)Just "basic_mpp">>>fmap featureName (featureByBit 17) -- odd bit also worksJust "basic_mpp">>>featureByBit 999Nothing
featureByName :: String -> Maybe Feature Source #
Look up a feature by its canonical name.
>>>fmap featureBaseBit (featureByName "basic_mpp")Just 16>>>featureByName "nonexistent"Nothing
Known features table
knownFeatures :: [Feature] Source #
The complete table of known features from BOLT #9.