elementsproject / lightning-charge-client-js Goto Github PK
View Code? Open in Web Editor NEWJavaScript client for lightning-charge
JavaScript client for lightning-charge
Looks like the shesek/superagent-use
it's breaking the installation process.
Lightning Charge Client requires to publish api secret like:
// Initialize the client
import ChargeClient from 'lightning-charge-client'
const charge = new ChargeClient('http://localhost:9112', '[API-TOKEN]')
But on Lightning Charge Documents, API token is said as mySecretToken
, it sounds API token must be secret. If I put API token on client side, everyone can know my API token. Is it secure?
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:
Thank you for your attention and for contributing to the lightning-network community!
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.