| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
LnUrl.Channel
Description
See https://github.com/fiatjaf/lnurl-rfc/blob/master/lnurl-channel.md.
Workflow
LN SERVICEprovides a URL forLNURL-channel.LN WALLETmakes aGETrequest to this URL.LN SERVICEresponds withResponseSuccessResponse.LN WALLETconnects to the node atremoteNode.LN WALLETprepare and make aGETrequest usingproceed(followed possibly bycancel).LN SERVICEresponds withAckResponse.LN WALLETawaits anOpenChannelmessage.
Synopsis
- proceed :: SuccessResponse -> NodeId -> Bool -> URI
- cancel :: SuccessResponse -> NodeId -> URI
- type NodeId = ByteString
- data SuccessResponse = SuccessResponse {
- remoteNode :: ByteString
- callback :: URI
- k1 :: ByteString
- data Response a
- = Success a
- | ErrorResponse Text
- data AckResponse
Client
proceed :: SuccessResponse -> NodeId -> Bool -> URI Source #
Create the URL for the follow up LNURL-channel request. LN SERVICE
responds with AckResponse.
cancel :: SuccessResponse -> NodeId -> URI Source #
Create the URL to cancel a LNURL-channel request. LN SERVICE responds
with AckResponse.
Types
type NodeId = ByteString Source #
data SuccessResponse Source #
LN SERVICE responds with Response SuccessResponse
Constructors
| SuccessResponse | |
Fields
| |
Instances
| Eq SuccessResponse Source # | |
Defined in LnUrl.Channel Methods (==) :: SuccessResponse -> SuccessResponse -> Bool # (/=) :: SuccessResponse -> SuccessResponse -> Bool # | |
| Show SuccessResponse Source # | |
Defined in LnUrl.Channel Methods showsPrec :: Int -> SuccessResponse -> ShowS # show :: SuccessResponse -> String # showList :: [SuccessResponse] -> ShowS # | |
| ToJSON SuccessResponse Source # | |
Defined in LnUrl.Channel Methods toJSON :: SuccessResponse -> Value # toEncoding :: SuccessResponse -> Encoding # toJSONList :: [SuccessResponse] -> Value # toEncodingList :: [SuccessResponse] -> Encoding # | |
| FromJSON SuccessResponse Source # | |
Defined in LnUrl.Channel Methods parseJSON :: Value -> Parser SuccessResponse # parseJSONList :: Value -> Parser [SuccessResponse] # | |
Constructors
| Success a | |
| ErrorResponse Text |
data AckResponse Source #
Constructors
| AckSuccess | |
| AckError Text |
Instances
| Eq AckResponse Source # | |
Defined in LnUrl | |
| Show AckResponse Source # | |
Defined in LnUrl Methods showsPrec :: Int -> AckResponse -> ShowS # show :: AckResponse -> String # showList :: [AckResponse] -> ShowS # | |
| ToJSON AckResponse Source # | |
Defined in LnUrl Methods toJSON :: AckResponse -> Value # toEncoding :: AckResponse -> Encoding # toJSONList :: [AckResponse] -> Value # toEncodingList :: [AckResponse] -> Encoding # | |
| FromJSON AckResponse Source # | |
Defined in LnUrl | |