How to use the ln-service.payViaRoutes function in ln-service

To help you get started, we’ve selected a few ln-service 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 alexbosworth / balanceofsatoshis / swaps / swap_out.js View on Github external
({decodeFundingRequest, findRouteForFunding}, cbk) =>
    {
      if (!!args.recovery) {
        return cbk();
      }

      args.logger.info({funding_swap: decodeFundingRequest.id});

      return payViaRoutes({
        id: decodeFundingRequest.id,
        lnd: args.lnd,
        routes: [findRouteForFunding],
      },
      cbk);
    }],
github alexbosworth / balanceofsatoshis / network / probe_destination.js View on Github external
pay: ['probe', 'to', ({probe, to}, cbk) => {
      if (!args.is_real_payment) {
        return cbk();
      }

      if (!probe.route) {
        return cbk();
      }

      if (args.max_fee !== undefined && probe.route.fee > args.max_fee) {
        return cbk([400, 'MaxFeeTooLow', {required_fee: probe.route.fee}]);
      }

      args.logger.info({paying: probe.route.hops.map(({channel}) => channel)});

      return payViaRoutes({
        id: to.id,
        lnd: args.lnd,
        routes: [probe.route],
      },
      cbk);
    }],
github submarineswaps / swaps-service / service / complete_swap_transaction.js View on Github external
({getRoute, lnd, parsedInvoice}, cbk) =>
    {
      return payViaRoutes({
        lnd,
        id: parsedInvoice.id,
        routes: [getRoute.route],
      },
      cbk);
    }],
github alexbosworth / balanceofsatoshis / swaps / rebalance.js View on Github external
pay: ['invoice', 'lnd', 'routes', ({invoice, lnd, routes}, cbk) => {
        return payViaRoutes({lnd, routes, id: invoice.id}, cbk);
      }],