mirror of https://github.com/lukechilds/lnbits.git
Eneko Illarramendi
5 years ago
7 changed files with 94 additions and 337 deletions
@ -0,0 +1,51 @@ |
|||
<q-expansion-item |
|||
group="extras" |
|||
icon="swap_vertical_circle" |
|||
label="API info" |
|||
:content-inset-level="0.5" |
|||
> |
|||
<q-expansion-item group="api" dense expand-separator label="Create an invoice (incoming)"> |
|||
<q-card> |
|||
<q-card-section> |
|||
<code><span class="text-light-green">POST</span> /api/v1/payments</code> |
|||
<h5 class="text-caption q-mt-sm q-mb-none">Headers</h5> |
|||
<code>{"Grpc-Metadata-macaroon": "<i>{{ wallet.inkey }}</i>"}</code><br /> |
|||
<h5 class="text-caption q-mt-sm q-mb-none">Body (application/json)</h5> |
|||
<code>{"out": false, "amount": <int>, "memo": <string>}</code> |
|||
<h5 class="text-caption q-mt-sm q-mb-none">Returns 201 CREATED (application/json)</h5> |
|||
<code>{"checking_id": <string>, "payment_request": <string>}</code> |
|||
<h5 class="text-caption q-mt-sm q-mb-none">Curl example</h5> |
|||
<code>curl -X POST http://127.0.0.1:5000/api/v1/payments -d '{"out": false, "amount": <int>, "memo": <string>}' -H "Grpc-Metadata-macaroon: <i>{{ wallet.inkey }}</i>" -H "Content-type: application/json"</code> |
|||
</q-card-section> |
|||
</q-card> |
|||
</q-expansion-item> |
|||
<q-expansion-item group="api" dense expand-separator label="Pay an invoice (outgoing)"> |
|||
<q-card> |
|||
<q-card-section> |
|||
<code><span class="text-light-green">POST</span> /api/v1/payments</code> |
|||
<h5 class="text-caption q-mt-sm q-mb-none">Headers</h5> |
|||
<code>{"Grpc-Metadata-macaroon": "{{ wallet.adminkey }}"}</code> |
|||
<h5 class="text-caption q-mt-sm q-mb-none">Body (application/json)</h5> |
|||
<code>{"out": true, "bolt11": <string>}</code> |
|||
<h5 class="text-caption q-mt-sm q-mb-none">Returns 201 CREATED (application/json)</h5> |
|||
<code>{"checking_id": <string>}</code> |
|||
<h5 class="text-caption q-mt-sm q-mb-none">Curl example</h5> |
|||
<code>curl -X POST http://127.0.0.1:5000/api/v1/payments -d '{"out": true, "bolt11": <string>}' -H "Grpc-Metadata-macaroon: {{ wallet.adminkey }}"</i> -H "Content-type: application/json"</code> |
|||
</q-card-section> |
|||
</q-card> |
|||
</q-expansion-item> |
|||
<q-expansion-item group="api" dense expand-separator label="Check an invoice (incoming or outgoing)" |
|||
class="q-mb-md"> |
|||
<q-card> |
|||
<q-card-section> |
|||
<code><span class="text-light-blue">GET</span> /api/v1/payments/<checking_id></code> |
|||
<h5 class="text-caption q-mt-sm q-mb-none">Headers</h5> |
|||
<code>{"Grpc-Metadata-macaroon": "{{ wallet.inkey }}"}</code> |
|||
<h5 class="text-caption q-mt-sm q-mb-none">Returns 200 OK (application/json)</h5> |
|||
<code>{"paid": <bool>}</code> |
|||
<h5 class="text-caption q-mt-sm q-mb-none">Curl example</h5> |
|||
<code>curl -X GET http://127.0.0.1:5000/api/v1/payments/<checking_id> -H "Grpc-Metadata-macaroon: {{ wallet.inkey }}"</i> -H "Content-type: application/json"</code> |
|||
</q-card-section> |
|||
</q-card> |
|||
</q-expansion-item> |
|||
</q-expansion-item> |
@ -1,265 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
{% extends "legacy.html" %} {% block messages %} |
|||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> |
|||
<i class="fa fa-bell-o"></i> |
|||
<span class="label label-danger">!</span> |
|||
</a> |
|||
<ul class="dropdown-menu"> |
|||
<li class="header"><b>Instant wallet, bookmark to save</b></li> |
|||
<li></li> |
|||
</ul> |
|||
{% endblock %} |
|||
|
|||
|
|||
{% block menuitems %} |
|||
<li class="active treeview"> |
|||
<a href="#"> |
|||
<i class="fa fa-bitcoin"></i> <span>Wallets</span> |
|||
<i class="fa fa-angle-left pull-right"></i> |
|||
</a> |
|||
<ul class="treeview-menu"> |
|||
{% for w in user_wallets %} |
|||
<li> |
|||
<a href="{{ url_for('wallet') }}?wal={{ w.id }}&usr={{ w.user }}"><i class="fa fa-bolt"></i> {{ w.name }}</a> |
|||
</li> |
|||
{% endfor %} |
|||
<li><a onclick="sidebarmake()">Add a wallet +</a></li> |
|||
<div id="sidebarmake"></div> |
|||
</ul> |
|||
</li> |
|||
<li class="treeview"> |
|||
<a href="#"> |
|||
<i class="fa fa-th"></i> <span>Extensions</span> |
|||
<i class="fa fa-angle-left pull-right"></i> |
|||
</a> |
|||
<ul class="treeview-menu"> |
|||
{% for extension in EXTENSIONS %} |
|||
{% if extension.code in user_ext %} |
|||
<li> |
|||
<a href="{{ url_for(extension.code + '.index') }}?usr={{ user }}"><i class="fa fa-plus"></i> {{ extension.name }}</a> |
|||
</li> |
|||
{% endif %} |
|||
{% endfor %} |
|||
<li> |
|||
<a href="{{ url_for('core.extensions') }}?usr={{ user }}">Manager</a></li> |
|||
</ul> |
|||
</li> |
|||
{% endblock %} |
|||
|
|||
{% block body %} |
|||
<!-- Right side column. Contains the navbar and content of the page --> |
|||
<div class="content-wrapper"> |
|||
<!-- Content Header (Page header) --> |
|||
<section class="content-header"> |
|||
<h1> |
|||
Wallet |
|||
<small |
|||
>Control panel |
|||
<div id="wonga"></div |
|||
></small> |
|||
</h1> |
|||
<ol class="breadcrumb"> |
|||
<li> |
|||
<a href="#"><i class="fa fa-dashboard"></i> Home</a> |
|||
</li> |
|||
<li class="active">Wallets</li> |
|||
<li href="wallet?wal={{ wallet.id }}" class="active"> |
|||
{{ wallet.name }} |
|||
</li> |
|||
</ol> |
|||
<br /><br /> |
|||
<div class="row"> |
|||
<div class="col-md-6"> |
|||
<div class="alert alert-danger alert-dismissable"> |
|||
<h4> |
|||
Wallet in BETA, use with caution. |
|||
</h4> |
|||
</div> |
|||
</div></div> |
|||
</section> |
|||
|
|||
<!-- Main content --> |
|||
<section class="content"> |
|||
<!-- Small boxes (Stat box) --> |
|||
<div class="row"> |
|||
<div class="col-md-6"> |
|||
<!-- small box --> |
|||
<div class="small-box bg-aqua"> |
|||
<div class="inner"> |
|||
<h3><b id="walletsats"></b></h3> |
|||
<h3>{{ wallet.name }}</h3> |
|||
</div> |
|||
<div class="icon"> |
|||
<i class="ion ion-flash"></i> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- ./col --> |
|||
|
|||
<!-- /.row --> |
|||
<div class="row"> |
|||
<div class="col-sm-3"> |
|||
<button |
|||
onclick="sendfundsinput()" |
|||
class="btn btn-block btn-primary btn-lg" |
|||
data-toggle="modal" |
|||
data-target=".sends" |
|||
> |
|||
Send |
|||
</button> |
|||
</div> |
|||
<div class="col-sm-3"> |
|||
<button |
|||
onclick="receive()" |
|||
class="btn btn-block btn-primary btn-lg" |
|||
data-toggle="modal" |
|||
data-target=".receives" |
|||
> |
|||
Receive |
|||
</button> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="row"> |
|||
<div class="col-sm-12"> |
|||
<div id="receive"></div> |
|||
<div id="sendfunds"></div> |
|||
</div> |
|||
</div> |
|||
<br/> |
|||
<div class="row"> |
|||
<div class="col-md-6"> |
|||
<div class="box"> |
|||
<div class="box-header"> |
|||
<h3 class="box-title">Transactions <small style="padding-left:30px;cursor: pointer;" onclick="exportbut()"><i>(Export to CSV)</i></small></h3> |
|||
</div> |
|||
<!-- /.box-header --> |
|||
<div class="box-body no-padding"> |
|||
<table id="pagnation" class="table table-bswearing anchorordered table-striped"> |
|||
<tr> |
|||
<th>Memo</th> |
|||
<th style="width: 20%">date</th> |
|||
<th style="width: 20%">amount</th> |
|||
</tr> |
|||
<tbody id="transactions"></tbody> |
|||
</table> |
|||
</div> |
|||
<!-- /.box-body --> |
|||
</div> |
|||
<!-- /.box --> |
|||
</div> |
|||
</div> |
|||
|
|||
<div id="satschart"></div> |
|||
|
|||
<div class="row"> |
|||
<div class="col-md-6"> |
|||
<div class="box box-solid"> |
|||
<div class="box-header with-border"></div> |
|||
<!-- /.box-header --> |
|||
<div class="box-body"> |
|||
<div class="box-group" id="accordion"> |
|||
<!-- we are adding the .panel class so bootstrap.js collapse plugin detects it --> |
|||
<div class="panel box box-primary"> |
|||
<div class="box-header with-border"> |
|||
<h4 class="box-title"> |
|||
<a |
|||
data-toggle="collapse" |
|||
data-parent="#accordion" |
|||
href="#collapseThree" |
|||
class="collapsed" |
|||
aria-expanded="false" |
|||
> |
|||
Wallet "{{ wallet.name }}" API info |
|||
</a> |
|||
</h4> |
|||
</div> |
|||
<div |
|||
id="collapseThree" |
|||
class="panel-collapse collapse" |
|||
aria-expanded="false" |
|||
> |
|||
<div class="box-body" style="word-wrap: break-word;"> |
|||
<b>Admin key: </b><i>{{ wallet.adminkey }}</i><br /> |
|||
<b>Invoice/Read key: </b><i>{{ wallet.inkey }}</i><br /> |
|||
Generate an invoice:<br /><code>POST /api/v1/invoices</code |
|||
><br />Header |
|||
<code |
|||
>{"Grpc-Metadata-macaroon": "<i>{{ wallet.inkey }}</i |
|||
>"}</code |
|||
><br /> |
|||
Body <code>{"value": "200","memo": "beer"} </code><br /> |
|||
Returns |
|||
<code>{"pay_req": string,"pay_id": string} </code><br /> |
|||
*payment will not register in the wallet until the "check |
|||
invoice" endpoint is used<br /><br /> |
|||
|
|||
Check invoice:<br /> |
|||
Check an invoice:<br /><code |
|||
>GET /api/v1/invoice/*payment_hash*</code |
|||
><br />Header |
|||
<code |
|||
>{"Grpc-Metadata-macaroon": "<i>{{ wallet.inkey }}</i |
|||
>"}</code |
|||
><br /> |
|||
|
|||
Returns |
|||
<code>{"PAID": "TRUE"}/{"PAID": "FALSE"} </code><br /> |
|||
*if using LNTXBOT return will hang until paid<br /><br /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="panel box box-danger"> |
|||
<div class="box-header with-border"> |
|||
<h4 class="box-title"> |
|||
<a |
|||
data-toggle="collapse" |
|||
data-parent="#accordion" |
|||
href="#collapseTwo" |
|||
class="collapsed" |
|||
aria-expanded="false" |
|||
> |
|||
Delete wallet |
|||
</a> |
|||
</h4> |
|||
</div> |
|||
<div |
|||
id="collapseTwo" |
|||
class="panel-collapse collapse" |
|||
aria-expanded="false" |
|||
> |
|||
<div class="box-body"> |
|||
This whole wallet will be deleted, the funds will be |
|||
UNRECOVERABLE <br /><br /><button |
|||
class="btn btn-danger" |
|||
onclick="deletewallet()" |
|||
> |
|||
Delete wallet |
|||
</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- /.box-body --> |
|||
</div> |
|||
<!-- /.box --> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- /.content --> |
|||
</section> |
|||
|
|||
<script> |
|||
window.user = {{ user | megajson | safe }} |
|||
window.user_wallets = {{ user_wallets | megajson | safe }} |
|||
window.wallet = {{ wallet | megajson | safe }} |
|||
window.transactions = {{ transactions | megajson | safe }} |
|||
|
|||
document.getElementById("walletsats").innerHTML = Math.round({{ wallet.balance }}) + " sats"; |
|||
</script> |
|||
</div> |
|||
{% endblock %} |
Loading…
Reference in new issue