ln-service
Advanced tools
Comparing version 5.0.0 to 5.0.1
@@ -30,2 +30,3 @@ const BN = require('bn.js'); | ||
fee: <Route Fee Tokens Number> | ||
timeout: <Timeout Block Height Number> | ||
}] | ||
@@ -32,0 +33,0 @@ } |
@@ -12,2 +12,3 @@ const BN = require('bn.js'); | ||
total_fees_msat: <Route Total Fees MSats String> | ||
total_time_lock: <Route Total Timelock Number> | ||
}] | ||
@@ -24,2 +25,3 @@ } | ||
fee: <Route Fee Tokens Number> | ||
timeout: <Timeout Block Height Number> | ||
}] | ||
@@ -44,3 +46,11 @@ } | ||
const invalidRoute = routes.find(route => { | ||
return typeof route.total_fees_msat !== 'string'; | ||
if (typeof route.total_fees_msat !== 'string') { | ||
return true; | ||
} | ||
if (typeof route.total_time_lock !== 'number') { | ||
return true; | ||
} | ||
return false; | ||
}); | ||
@@ -56,3 +66,6 @@ | ||
return {fee: totalFeesMsat.div(msatsPerToken).toNumber()}; | ||
return { | ||
fee: totalFeesMsat.div(msatsPerToken).toNumber(), | ||
timeout: route.total_time_lock, | ||
}; | ||
}), | ||
@@ -59,0 +72,0 @@ }; |
@@ -16,3 +16,3 @@ { | ||
"express-basic-auth": "1.1.5", | ||
"grpc": "1.12.2", | ||
"grpc": "1.12.4", | ||
"lodash": "4.17.10", | ||
@@ -23,3 +23,3 @@ "morgan": "1.9.0", | ||
"walnut": "0.0.4", | ||
"ws": "5.2.0" | ||
"ws": "5.2.1" | ||
}, | ||
@@ -51,3 +51,3 @@ "description": "Interaction helper for your Lightning Network daemon", | ||
}, | ||
"version": "5.0.0" | ||
"version": "5.0.1" | ||
} |
@@ -27,3 +27,3 @@ const {deepIs} = require('tap'); | ||
error: 'ExpectedValidRoutes', | ||
response: {routes: [{total_fees_msat: null}]}, | ||
response: {routes: [{total_fees_msat: null, total_time_lock: 31337}]}, | ||
}, | ||
@@ -33,4 +33,4 @@ | ||
_: 'Valid routes', | ||
expected: {routes: [{fee: 1}]}, | ||
response: {routes: [{total_fees_msat: '1000'}]}, | ||
expected: {routes: [{fee: 1, timeout: 31337}]}, | ||
response: {routes: [{total_fees_msat: '1000', total_time_lock: 31337}]}, | ||
}, | ||
@@ -37,0 +37,0 @@ ]; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
180823
3550
+ Addedgrpc@1.12.4(transitive)
+ Addedws@5.2.1(transitive)
- Removedgrpc@1.12.2(transitive)
- Removedws@5.2.0(transitive)
Updatedgrpc@1.12.4
Updatedws@5.2.1