Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ln-service

Package Overview
Dependencies
Maintainers
1
Versions
517
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ln-service - npm Package Compare versions

Comparing version 3.0.4 to 3.0.6

lnd/index.js

24

lightning/get_routes.js

@@ -0,5 +1,9 @@

const BN = require('bn.js');
const {isFinite} = require('lodash');
const {routesFromQueryRoutes} = require('./../lnd');
const defaultRoutesReturnCount = 10;
const intBase = 10;
const msatsPerToken = 1e3;

@@ -57,21 +61,9 @@ const pathNotFoundErrors = [

if (!res || !Array.isArray(res.routes)) {
return cbk([503, 'ExpectedRoutes']);
try {
return cbk(null, routesFromQueryRoutes({response: res}));
} catch (e) {
return cbk([503, 'InvalidGetRoutesResponse', e]);
}
const invalidRoutes = res.routes
.map(route => parseInt(route.total_fees, intBase))
.filter(fees => !isFinite(fees));
if (!!invalidRoutes.length) {
return cbk([503, 'ExpectedValidRoutes']);
}
const routes = res.routes.map(route => {
return {fee: parseInt(route.total_fees, intBase)};
});
return cbk(null, {routes});
});
};

@@ -14,2 +14,4 @@ const asyncAuto = require('async/auto');

{
[chain_fee_tokens_per_vbyte]: <Chain Fee Tokens Per VByte Number>
[give_tokens]: <Tokens to Give To Partner Number>
lnd: <LND GRPC API Object>

@@ -54,7 +56,17 @@ [local_tokens]: <Local Tokens Number> // When not set, uses max possible

const open = args.lnd.openChannel({
const options = {
local_funding_amount: channelAmount - staticFee,
node_pubkey: Buffer.from(args.partner_public_key, 'hex'),
});
}
if (!!args.chain_fee_tokens_per_vbyte) {
options.sat_per_byte = chain_fee_tokens_per_vbyte;
}
if (!!args.give_tokens) {
options.push_sat = args.give_tokens;
}
const open = args.lnd.openChannel(options);
open.on('data', chan => {

@@ -61,0 +73,0 @@ switch (chan.update) {

@@ -15,8 +15,7 @@ {

"express": "4.16.3",
"express-basic-auth": "1.1.4",
"express-basic-auth": "1.1.5",
"grpc": "1.10.1",
"lodash": "4.17.5",
"lodash": "4.17.10",
"morgan": "1.9.0",
"request": "2.85.0",
"safe-buffer": "5.1.1",
"secp256k1": "3.5.0",

@@ -28,7 +27,7 @@ "walnut": "0.0.3",

"devDependencies": {
"tap": "11.1.1"
"tap": "11.1.4"
},
"engines": {
"node": "6.13.1",
"npm": "3.10.10"
"node": ">=8.11.1",
"npm": "5.8.0"
},

@@ -49,5 +48,6 @@ "keywords": [

"scripts": {
"start": "node server.js",
"test": "tap test/*.js"
},
"version": "3.0.4"
"version": "3.0.6"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc