mirror of
https://github.com/bumi/lntip
synced 2025-06-16 17:55:35 +00:00
readme
This commit is contained in:
parent
2e7649eeef
commit
414e31e4df
16
README.md
16
README.md
@ -3,11 +3,14 @@
|
|||||||
LnTip provides a Bitcoin lightning tipping widget that can easily be integrated into any website.
|
LnTip provides a Bitcoin lightning tipping widget that can easily be integrated into any website.
|
||||||
|
|
||||||
It consistes of a small service written in Go that connects to a lnd node and exposes
|
It consistes of a small service written in Go that connects to a lnd node and exposes
|
||||||
a simple HTTP JSON API to create and monitor invoices. This API is used from a tiny
|
a simple HTTP JSON API to create and monitor invoices. That API is used from a tiny
|
||||||
JavaScript widget that integrated in any website.
|
JavaScript widget that integrates in any website.
|
||||||
|
|
||||||
See it in action: [moneyz.michaelbumann.com](http://moneyz.michaelbumann.com)
|
See it in action: [moneyz.michaelbumann.com](http://moneyz.michaelbumann.com)
|
||||||
|
|
||||||
|
If [webln](https://github.com/wbobeirne/webln) is available it will be used to request the payment;
|
||||||
|
otherwise a overlay will be shown with the payment request and a QR code.
|
||||||
|
|
||||||
## Motivation
|
## Motivation
|
||||||
|
|
||||||
Besides experimenting with lnd and Go... :) I wanted a simple tipping button for my website
|
Besides experimenting with lnd and Go... :) I wanted a simple tipping button for my website
|
||||||
@ -47,10 +50,19 @@ to the host and port on which your lntip instance is running:
|
|||||||
|
|
||||||
#### Usage
|
#### Usage
|
||||||
|
|
||||||
|
To request a lightning payment simply call `request()` on a `new LnTip({amount: amount, memo: memo})`:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
new LnTip({ amount: 1000, memo: 'high5' }).request()
|
new LnTip({ amount: 1000, memo: 'high5' }).request()
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Use it from a plain HTML link:
|
||||||
|
```html
|
||||||
|
<a href="#" onclick="javascript:new LnTip({ amount: 1000, memo: 'high5' }).request();return false;">Tip me</a>
|
||||||
|
```
|
||||||
|
|
||||||
|
##### More advanced JS API:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let tip = new LnTip({ amount: 1000, memo: 'high5' });
|
let tip = new LnTip({ amount: 1000, memo: 'high5' });
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user