Coder Social home page Coder Social logo

elementsproject / paypercall Goto Github PK

View Code? Open in Web Editor NEW
146.0 14.0 17.0 70 KB

Charge for HTTP APIs on a pay-per-call basis with Bitcoin and Lightning :zap:

Home Page: https://www.blockstream.com/2018/03/25/paypercall-shows-the-full-power-of-lightning-charge.html

License: MIT License

JavaScript 100.00%
bitcoin lightning lightning-charge apis pay-per-call micropayments nanopayments

paypercall's People

Contributors

shesek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

paypercall's Issues

Allow purchasing access tokens in bulk

Useful to reduce lightning fees even further, if you know ahead of time that you're going to send lots of API requests.

Might make sense to let the service operator set some discount for bulk orders, too.

Allow to mark API execution as failed (and don't charge them)

Allow services to signal that API execution has failed, which should free up the payment token and allow it to be used for another API call.

  • If the X-Charge response header is set to yes, consider the request a success and mark the payment token as spent. If the X-Charge header is set to any other value (normally no), consider the request a failure and mark the payment token as usable.

  • If the X-Charge response header is not specified,

    • If the --explicit-charge config option is set, consider the request a failure.

    • If the --explicit-charge config option is not set, consider the request a success if the status code is 2xx or 3xx, otherwise consider it a failure.

Freeing up the payment token means removing it from the spent table, which means we should log the execution error to a separate (new) table.

Add lightning-network as a topic to this repository

Hello,

This repository is listed on the Awesome Lightning-Network list, which is a collection of useful lightning-network projects. However, it seems that the 'lightning-network' topic is missing from this repository's topics.

Adding the 'lightning-network' topic will help users discover your project more easily and recognize its relevance to the lightning-network ecosystem. To add the topic, please follow these steps:

  1. Navigate to the main page of the repository.
  2. Click on the gear icon next to "About" on the right side of the page.
  3. In the "Topics" section, type 'lightning-network' and press Enter.
  4. Click "Save changes."

Thank you for your attention and for contributing to the lightning-network community!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.