Browse Source

Added some endpoit documentation for newcomers.

renovate/lint-staged-8.x
João Almeida 8 years ago
parent
commit
b65c02306b
  1. 11
      app/lnd/methods/channelController.js
  2. 8
      app/lnd/methods/invoicesController.js
  3. 8
      app/lnd/methods/networkController.js
  4. 14
      app/lnd/methods/paymentsController.js
  5. 6
      app/lnd/methods/peersController.js
  6. 10
      app/lnd/methods/walletController.js

11
app/lnd/methods/channelController.js

@ -5,6 +5,7 @@ import pushclosechannel from '../push/closechannel'
const BufferUtil = bitcore.util.buffer const BufferUtil = bitcore.util.buffer
/** /**
* Attempts to open a singly funded channel specified in the request to a remote peer.
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @param {[type]} event [description] * @param {[type]} event [description]
* @param {[type]} payload [description] * @param {[type]} payload [description]
@ -28,7 +29,7 @@ export function openChannel(lnd, event, payload) {
/** /**
* [channelBalance description] * Returns the total funds available across all open channels in satoshis
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @return {[type]} [description] * @return {[type]} [description]
*/ */
@ -45,7 +46,7 @@ export function channelBalance(lnd) {
/** /**
* [listChannels description] * Returns a description of all the open channels that this node is a participant in
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @return {[type]} [description] * @return {[type]} [description]
*/ */
@ -62,7 +63,7 @@ export function listChannels(lnd) {
/** /**
* [closechannel description] * Attempts to close an active channel identified by its channel outpoint (ChannelPoint)
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @param {[type]} event [description] * @param {[type]} event [description]
* @param {[type]} payload [description] * @param {[type]} payload [description]
@ -87,7 +88,7 @@ export function closeChannel(lnd, event, payload) {
/** /**
* [pendingChannels description] * Returns a list of all the channels that are currently considered pending"
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @return {[type]} [description] * @return {[type]} [description]
*/ */
@ -104,7 +105,7 @@ export function pendingChannels(lnd) {
/** /**
* [getChanInfo description] * Returns the latest authenticated network announcement for the given channel
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @param {[type]} channelId [description] * @param {[type]} channelId [description]
* @return {[type]} [description] * @return {[type]} [description]

8
app/lnd/methods/invoicesController.js

@ -1,7 +1,7 @@
import { decodeInvoice } from '../utils' import { decodeInvoice } from '../utils'
/** /**
* [createInvoice description] * Attempts to add a new invoice to the invoice database.
* @param lnd [description] * @param lnd [description]
* @param memo [description] * @param memo [description]
* @param value [description] * @param value [description]
@ -18,7 +18,7 @@ export function addInvoice (lnd, { memo, value }) {
} }
/** /**
* [listInvoices description] * Returns a list of all the invoices currently stored within the database
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @return {[type]} [description] * @return {[type]} [description]
*/ */
@ -51,7 +51,7 @@ export function getInvoice(payreq) {
/** /**
* [lookupInvoice description] * Attemps to look up an invoice according to its payment hash
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @param {[type]} rhash [description] * @param {[type]} rhash [description]
* @return {[type]} [description] * @return {[type]} [description]
@ -69,7 +69,7 @@ export function lookupInvoice(lnd, { rhash }) {
/** /**
* [subscribeInvoices description] * Returns a uni-directional stream (server -> client) for notifying the client of newly added/settled invoices
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @param {[type]} event [description] * @param {[type]} event [description]
* @return {[type]} [description] * @return {[type]} [description]

8
app/lnd/methods/networkController.js

@ -16,7 +16,7 @@ export function getInfo(lnd) {
/** /**
* [getNodeInfo description] * Returns general information concerning the lightning node
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @param {[type]} pubkey [description] * @param {[type]} pubkey [description]
* @return {[type]} [description] * @return {[type]} [description]
@ -34,7 +34,7 @@ export function getNodeInfo(lnd, { pubkey }) {
/** /**
* [describeGraph description] * Returns a description of the latest graph state from the point of view of the node
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @return {[type]} [description] * @return {[type]} [description]
*/ */
@ -51,7 +51,7 @@ export function describeGraph(lnd) {
/** /**
* [queryRoutes description] * Attempts to query the daemons Channel Router for a possible route to a target destination capable of carrying a specific amount of satoshis
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @param {[type]} pubkey [description] * @param {[type]} pubkey [description]
* @param {[type]} amount [description] * @param {[type]} amount [description]
@ -70,7 +70,7 @@ export function queryRoutes(lnd, { pubkey, amount }) {
/** /**
* [getNetworkInfo description] * Returns some basic stats about the known channel graph from the point of view of the node
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @return {[type]} [description] * @return {[type]} [description]
*/ */

14
app/lnd/methods/paymentsController.js

@ -1,5 +1,5 @@
/** /**
* [sendPaymentSync description] * Dispatches a bi-directional streaming RPC for sending payments through the Lightning Network.
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @param {[type]} paymentRequest [description] * @param {[type]} paymentRequest [description]
* @return {[type]} [description] * @return {[type]} [description]
@ -17,7 +17,7 @@ export function sendPaymentSync(lnd, { paymentRequest }) {
/** /**
* [sendPayment description] * Synchronous non-streaming version of SendPayment
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @param {[type]} paymentRequest [description] * @param {[type]} paymentRequest [description]
* @return {[type]} [description] * @return {[type]} [description]
@ -34,7 +34,7 @@ export function sendPayment(lnd, { paymentRequest }) {
} }
/** /**
* [decodePayReq description] * Returns a full description of the conditions encoded within the payment request
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @param {[type]} payReq [description] * @param {[type]} payReq [description]
* @return {[type]} [description] * @return {[type]} [description]
@ -51,7 +51,7 @@ export function decodePayReq(lnd, { payReq }) {
} }
/** /**
* [listPayments description] * Returns a list of all outgoing payments
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @return {[type]} [description] * @return {[type]} [description]
*/ */
@ -66,7 +66,11 @@ export function listPayments(lnd) {
}) })
} }
/**
* Deletes all outgoing payments from DB.
* @param {[type]} lnd [description]
* @return {[type]} [description]
*/
export function deleteAllPayments(lnd) { export function deleteAllPayments(lnd) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {

6
app/lnd/methods/peersController.js

@ -1,5 +1,5 @@
/** /**
* [connectpeer description] * Attempts to establish a connection to a remote peer
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @param {[type]} pubkey [description] * @param {[type]} pubkey [description]
* @param {[type]} host [description] * @param {[type]} host [description]
@ -18,7 +18,7 @@ export function connectPeer(lnd, { pubkey, host }) {
/** /**
* [disconnectpeer description] * Attempts to disconnect one peer from another
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @param {[type]} pubkey [description] * @param {[type]} pubkey [description]
* @return {[type]} [description] * @return {[type]} [description]
@ -36,7 +36,7 @@ export function disconnectPeer(lnd, { pubkey }) {
/** /**
* [peers description] * Returns a verbose listing of all currently active peers
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @return {[type]} [description] * @return {[type]} [description]
*/ */

10
app/lnd/methods/walletController.js

@ -1,5 +1,5 @@
/** /**
* [walletbalance description] * Returns the sum of all confirmed unspent outputs under control by the wallet
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @return {[type]} [description] * @return {[type]} [description]
*/ */
@ -16,7 +16,7 @@ export function walletBalance(lnd) {
/** /**
* [newAddress description] * Creates a new address under control of the local wallet
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @param {[type]} type [description] * @param {[type]} type [description]
* @return {[type]} [description] * @return {[type]} [description]
@ -33,7 +33,7 @@ export function newAddress(lnd, type) {
} }
/** /**
* [newWitnessAddress description] * Creates a new witness address under control of the local wallet
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @return {[type]} [description] * @return {[type]} [description]
*/ */
@ -50,7 +50,7 @@ export function newWitnessAddress(lnd, { addr }) {
/** /**
* [getTransactions description] * Returns a list describing all the known transactions relevant to the wallet
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @return {[type]} [description] * @return {[type]} [description]
*/ */
@ -67,7 +67,7 @@ export function getTransactions(lnd) {
/** /**
* [sendcoins description] * Executes a request to send coins to a particular address
* @param {[type]} lnd [description] * @param {[type]} lnd [description]
* @param {[type]} addr [description] * @param {[type]} addr [description]
* @param {[type]} amount [description] * @param {[type]} amount [description]

Loading…
Cancel
Save