Giter Site home page Giter Site logo

elementsproject / lightning-charge-client-js Goto Github PK

View Code? Open in Web Editor NEW
64.0 14.0 17.0 249 KB

JavaScript client for lightning-charge

JavaScript 100.00%
bitcoin lightning lightning-charge lightning-charge-client nodejs javascript lightning-network

lightning-charge-client-js's People

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

Watchers

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

lightning-charge-client-js's Issues

Initialize the client with remote node

Hello,

I set up a Lightning Charge node on Azure, and I can use the command line to generate invoices, but I am having trouble getting this JS library to work.

This is the code I'm using currently to create to the remote node:

var axios = require('axios');
var url = "https://api-token:<API_TOKEN_HERE>@light.konelabs.com/"
axios.post(url + 'invoice', {
  msatoshi: 100000,
  metadata: {
    customer_id: 123,
    product_id: 456
  }
})
  .then(d => console.log(d.data))
  .catch(e => console.log(e))

But I think I'm setting up something wrong when using this library:

var ChargeClient = require('lightning-charge-client');
const charge = require('lightning-charge-client')('https://api-token:<API_TOKEN_HERE>@light.konelabs.com/', 'https://light.konelabs.com/')
const inv = charge.invoice({ msatoshi: 50, metadata: { customer_id: 123, product_id: 456 } })
inv
.then(i => console.log(i))
.catch(e => console.log(e))

Anyone have an idea on what I'm doing wrong?

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.