| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
LnUrl.Withdraw
Description
See https://github.com/fiatjaf/lnurl-rfc/blob/master/lnurl-withdraw.md.
Workflow
LN WALLETmakesGETrequestLN SERVICEresponds withResponseSuccessResponse.LN WALLETget withdrawal amount from user.LN WALLETprepare and makeGETrequest usinggetCallbackURL.LN SERVICEresponds withAckResponse.
Synopsis
- getCallbackURL :: SuccessResponse -> Text -> Maybe URI -> URI
- data Response a
- = Success a
- | ErrorResponse Text
- data SuccessResponse = SuccessResponse {}
- data AckResponse
Client
Arguments
| :: SuccessResponse | |
| -> Text | |
| -> Maybe URI | URL where |
| -> URI |
Use the first response to build the callback url
Types
Constructors
| Success a | |
| ErrorResponse Text |
data SuccessResponse Source #
The initial GET request responds with Response SuccessResponse
Constructors
| SuccessResponse | |
Fields
| |
Instances
| Eq SuccessResponse Source # | |
Defined in LnUrl.Withdraw Methods (==) :: SuccessResponse -> SuccessResponse -> Bool # (/=) :: SuccessResponse -> SuccessResponse -> Bool # | |
| Show SuccessResponse Source # | |
Defined in LnUrl.Withdraw Methods showsPrec :: Int -> SuccessResponse -> ShowS # show :: SuccessResponse -> String # showList :: [SuccessResponse] -> ShowS # | |
| ToJSON SuccessResponse Source # | |
Defined in LnUrl.Withdraw Methods toJSON :: SuccessResponse -> Value # toEncoding :: SuccessResponse -> Encoding # toJSONList :: [SuccessResponse] -> Value # toEncodingList :: [SuccessResponse] -> Encoding # | |
| FromJSON SuccessResponse Source # | |
Defined in LnUrl.Withdraw Methods parseJSON :: Value -> Parser SuccessResponse # parseJSONList :: Value -> Parser [SuccessResponse] # | |
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 | |