lnurl-0.1.0.0: Support for developing against the LNURL protocol
Safe HaskellNone
LanguageHaskell2010

LnUrl.Auth

Description

See https://github.com/fiatjaf/lnurl-rfc/blob/master/lnurl-auth.md.

Workflow

  1. LN SERVICE Use mkAuthUrl to generate.
  2. LN WALLET Decode LNURL and parse with parseAuthUrl.
  3. LN WALLET Display AuthUrl details and get consent from user to authorize.
  4. LN WALLET Use getSignedCallback to prepare follow-up GET request
  5. LN SERVICE Responds with AckResponse.
Synopsis

Server

mkAuthUrl :: URI -> Msg -> Maybe Action -> URI Source #

Add the challenge and action parameters to a URI

Client

parseAuthUrl :: String -> Maybe AuthUrl Source #

Attempt to interpret a URL as an LNURL-auth URL

getSignedCallback Source #

Arguments

:: XPrvKey

Root key

-> AuthUrl 
-> URI

Callback url with client-provided LNURL-auth paramaters

Use the linking key to sign a challenge

Types

data AuthUrl Source #

Constructors

AuthUrl 

Fields

Instances

Instances details
Eq AuthUrl Source # 
Instance details

Defined in LnUrl.Auth

Methods

(==) :: AuthUrl -> AuthUrl -> Bool #

(/=) :: AuthUrl -> AuthUrl -> Bool #

Show AuthUrl Source # 
Instance details

Defined in LnUrl.Auth

data Action Source #

Constructors

Register 
Login 
Link 
Auth 

Instances

Instances details
Eq Action Source # 
Instance details

Defined in LnUrl.Auth

Methods

(==) :: Action -> Action -> Bool #

(/=) :: Action -> Action -> Bool #

Show Action Source # 
Instance details

Defined in LnUrl.Auth

data AckResponse Source #

Constructors

AckSuccess 
AckError Text 

Instances

Instances details
Eq AckResponse Source # 
Instance details

Defined in LnUrl

Show AckResponse Source # 
Instance details

Defined in LnUrl

ToJSON AckResponse Source # 
Instance details

Defined in LnUrl

FromJSON AckResponse Source # 
Instance details

Defined in LnUrl

Utilities

deriveLinkingKey Source #

Arguments

:: XPrvKey 
-> ByteString

domain

-> SecKey 

Derive the linking key from the domain

deriveLinkingPubKey Source #

Arguments

:: XPrvKey 
-> ByteString

domain

-> PubKey 

Derive a public signing key