NAV Navbar
javascript
  • Introduction
  • Installation
  • Addresses
  • Errors
  • Introduction

    The LND Adapter is an adapter that wraps a library originally @alexbosworth to manage an LND node with JavaScript using gRpc.

    Below are some of the end-points that are available.

    Installation

    Install the lnd-adapter in any project. With CoinMesh, we recommend using it through a logic service.

    $ npm install @coinmesh/lnd-adapter
    

    Addresses

    Create a new Address

    const addresses = require('lnd-adapter').addresses;
    
    addresses.createAddress().then(newAddress => {
      console.log(newAddress);
    });
    

    The above command returns JSON structured like this:

    {
      "id": 1,
      "address": 123456701239
    }
    

    Errors

    The Kittn API uses the following error codes:

    Error Code Meaning
    400 Bad Request -- Your request is invalid.
    401 Unauthorized -- Your API key is wrong.
    403 Forbidden -- The kitten requested is hidden for administrators only.
    404 Not Found -- The specified kitten could not be found.
    405 Method Not Allowed -- You tried to access a kitten with an invalid method.
    406 Not Acceptable -- You requested a format that isn't json.
    410 Gone -- The kitten requested has been removed from our servers.
    418 I'm a teapot.
    429 Too Many Requests -- You're requesting too many kittens! Slow down!
    500 Internal Server Error -- We had a problem with our server. Try again later.
    503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.