How to use lnd-async - 1 common examples

To help you get started, we’ve selected a few lnd-async examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github altangent / lnd-explorer / src / server / lnd.js View on Github external
async function connect() {
  try {
    let lndHost = process.env.LND_HOST;
    let lndPort = process.env.LND_PORT;
    let certPath = process.env.LND_CERT_PATH;
    let macaroonPath = process.env.LND_MACAROON_PATH;
    let noMacaroons = process.env.LND_NO_MACAROONS;

    lndPort = parseInt(lndPort) || undefined; // integer or undefined
    noMacaroons = noMacaroons === 'true' || undefined; // true or undefined

    // connect with supplied options or let connection
    // defaults take precedence by passing undefined
    _instance = await lndAsync.connect({
      lndHost,
      lndPort,
      certPath,
      macaroonPath,
      noMacaroons,
    });

    winston.info('connected to lnd');
  } catch (ex) {
    winston.error(ex);
    process.exit(1);
  }
}

lnd-async

Lightning Network Daemon (LND) gRPC client with native promise support

MIT
Latest version published 6 months ago

Package Health Score

47 / 100
Full package analysis

Popular lnd-async functions