LightningHub API documentation version v1
http://api.bluewallet.io/{version}
- version: required(v1)
Home
Welcome to the LightningHub API Documentation. The LightningHub API allows you to connect your Bitcoin/Lightning Bluewallet App and serve multiple user accounts via a shared Lightning Node.
Authentication
Most of the API requests require authentication. This is done via a request header named Authorization:
containing an access token, which has to be send along with every request. To obtain an access token, the following steps have to be performed:
- Create an account via the
/create
resource. - Create an access token via the
/auth
resource using the credentials (login/password) returned in step 1. - Provide the access token returned in step 2 as the value of the
Authorization
header in every following request.
Error codes
This API returns errors as a JSON object in the following format:
{
"error": true,
"code": <INTEGER>,
"message": "<DESCRIPTION>",
}
The following error codes
are defined:
1
: bad authentication2
: not enough balance4
: not a valid invoice6
: server fault7
: Lightning node failure8
: bad arguments9
: payment in transit10
: payment failed
Lighting Node Info
Create new account
Get access token
Show Account Balance
Show Funding Address
Show Pending Deposits
Show on-chain funding transactions with less than 3 confirmations for the authenticated user's account. Deposits will only be credited to the user's spendable account balance after the funding transaction received 3 confirmations.
Get a list of pending deposits along with their details for the authenticated user's custody account.
Create Lightning invoice
Create BOLT-11 compatible Lightning invoices
Request a BOLT-11 compatible Lightning invoice that can be paid by any other BOLT-11 compatible wallet. If the invoice is paid the respective amount will be credited to the authenticated user who created it.
Pay Lightning invoices
Pay BOLT-11 compatible Lightning invoices
Request a BOLT-11 compatible Lightning invoice to be paid by the custodian. If the payment is successful, the respective amount + a fee is substracted from the authenticated user's balance.
Show Transaction History
Show Invoices
Show Lightning invoices created by the authenticated user.
Get a list of Lightning invoices along with their payment status details for the authenticated user's custody account.
Decode Lightning Invoice
Decode a Lightning invoice into a human readable format.
Decode a BOLT-11 compatible Lightning invoice into a human readable format. Uses the implementation of the connected Lightning node so the client app doesn't have to implement this.