Skip to content

Add package for client-side functionality #20

Closed
@philippgille

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(...)), just Do(...)
    • 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions