Safe Haskell | None |
---|---|
Language | Haskell2010 |
See https://github.com/fiatjaf/lnurl-rfc/blob/master/lnurl-auth.md.
Workflow
LN SERVICE
UsemkAuthUrl
to generate.LN WALLET
DecodeLNURL
and parse withparseAuthUrl
.LN WALLET
DisplayAuthUrl
details and get consent from user to authorize.LN WALLET
UsegetSignedCallback
to prepare follow-upGET
requestLN SERVICE
Responds withAckResponse
.
Synopsis
- mkAuthUrl :: URI -> Msg -> Maybe Action -> URI
- parseAuthUrl :: String -> Maybe AuthUrl
- authDomain :: AuthUrl -> String
- getSignedCallback :: XPrvKey -> AuthUrl -> URI
- data AuthUrl = AuthUrl {}
- data Action
- actionText :: Action -> Text
- parseAction :: Text -> Maybe Action
- data AckResponse
- deriveLinkingKey :: XPrvKey -> ByteString -> SecKey
- deriveLinkingPubKey :: XPrvKey -> ByteString -> PubKey
Server
mkAuthUrl :: URI -> Msg -> Maybe Action -> URI Source #
Add the challenge and action parameters to a URI
Client
authDomain :: AuthUrl -> String Source #
Use the linking key to sign a challenge
Types
actionText :: Action -> Text Source #
data AckResponse Source #
Instances
Eq AckResponse Source # | |
Defined in LnUrl (==) :: AckResponse -> AckResponse -> Bool # (/=) :: AckResponse -> AckResponse -> Bool # | |
Show AckResponse Source # | |
Defined in LnUrl showsPrec :: Int -> AckResponse -> ShowS # show :: AckResponse -> String # showList :: [AckResponse] -> ShowS # | |
ToJSON AckResponse Source # | |
Defined in LnUrl toJSON :: AckResponse -> Value # toEncoding :: AckResponse -> Encoding # toJSONList :: [AckResponse] -> Value # toEncodingList :: [AckResponse] -> Encoding # | |
FromJSON AckResponse Source # | |
Defined in LnUrl parseJSON :: Value -> Parser AckResponse # parseJSONList :: Value -> Parser [AckResponse] # |
Utilities
:: XPrvKey | |
-> ByteString | domain |
-> SecKey |
Derive the linking key from the domain