Closed
Description
Currently when a developer uses an API that's paywalled with ln-paywall (or ElementProject's paypercall and potentially other projects in the future), he has to take care of:
- Sending two physical requests for one logical one
- Handling the 402 response
- Establishing a connection to his Lightning Network node by himself and calling its RPC / HTTP API
All by himself.
This can be easily wrapped in a way so that the developer only has to create one instance of a client, similar to the net/http.Client
, create a single net/http.Request
and then call client.Do(...)
. Just as with the net/http.Client
. All the payment handling can happen automatically in the background.
The first goal should be a minimal working version. More advaned features should be added in the future with separate issues created for each feature.
Minimal working version:
- Connects to and works with lnd
- No convenience methods (
Get(...)
,Post(...)
), justDo(...)
- Are they exposed by the embedded HTTP client? Can they be hidden in that case?
- No configuration like "only pay if the amount in the invoice is <= x BTC", just always pay the invoice
Future features:
- Support other LN node implementations
- Make payments configurable, e.g. "only pay if the amount in the invoice is <= x BTC"
- ...
Activity