Comparing version 1.3.0 to 1.4.0
@@ -0,1 +1,2 @@ | ||
const {chanFormat} = require('./lib'); | ||
const {chanNumber} = require('./lib'); | ||
@@ -6,3 +7,9 @@ const {decodeChanId} = require('./lib'); | ||
module.exports = {chanNumber, decodeChanId, encodeChanId, rawChanId}; | ||
module.exports = { | ||
chanFormat, | ||
chanNumber, | ||
decodeChanId, | ||
encodeChanId, | ||
rawChanId, | ||
}; | ||
@@ -13,2 +13,5 @@ const BN = require('bn.js'); | ||
@throws | ||
<ExpectedChannelIdOrComponentsToConvertToNumber Error> | ||
@returns | ||
@@ -15,0 +18,0 @@ { |
const {blockIndexByteLen} = require('./constants'); | ||
const {blockIndexOffset} = require('./constants'); | ||
const {decBase} = require('./constants'); | ||
const {heightByteLen} = require('./constants'); | ||
@@ -19,3 +18,4 @@ const {heightByteOffset} = require('./constants'); | ||
@throws | ||
<Error> | ||
<ExpectedChannelIdBuffer Error> | ||
<UnexpectedByteCountForShortChannelId Error> | ||
@@ -22,0 +22,0 @@ @returns |
@@ -6,3 +6,2 @@ const {blockIndexByteLen} = require('./constants'); | ||
const {decBase} = require('./constants'); | ||
const {endian} = require('./constants'); | ||
const {heightByteLen} = require('./constants'); | ||
@@ -25,3 +24,5 @@ const {heightByteOffset} = require('./constants'); | ||
@throws | ||
<Error> | ||
<ExpectedShortChannelIdToDecode Error> | ||
<UnexpectedErrorDecodingChannelIdNumber Error> | ||
<UnexpectedLengthOfShortChannelId Error> | ||
@@ -36,2 +37,3 @@ @returns | ||
module.exports = ({channel, id, number}) => { | ||
// Exit early when there is no need to decode components from a buffer | ||
if (!!channel) { | ||
@@ -38,0 +40,0 @@ const [height, blockIndex, outputindex] = channel.split(chanDelimiter); |
@@ -22,7 +22,9 @@ const BN = require('bn.js'); | ||
@throws | ||
<Error> | ||
<ExpectedBlockHeightForChannelId Error> | ||
<ExpectedBlockIndexForChannelId Error> | ||
<ExpectedTransactionOutputIndexForChannelId Error> | ||
@returns | ||
{ | ||
channel: <Channel Components String> | ||
channel: <Channel Components Format String> | ||
id: <Channel Id Hex String> | ||
@@ -34,3 +36,3 @@ number: <Channel Number String> | ||
if (args.block_height === undefined) { | ||
throw new Error('ExpectedBlockHeightForChannelid'); | ||
throw new Error('ExpectedBlockHeightForChannelId'); | ||
} | ||
@@ -37,0 +39,0 @@ |
@@ -0,1 +1,2 @@ | ||
const chanFormat = require('./chan_format'); | ||
const chanNumber = require('./chan_number'); | ||
@@ -6,3 +7,9 @@ const decodeChanId = require('./decode_chan_id'); | ||
module.exports = {chanNumber, decodeChanId, encodeChanId, rawChanId}; | ||
module.exports = { | ||
chanFormat, | ||
chanNumber, | ||
decodeChanId, | ||
encodeChanId, | ||
rawChanId, | ||
}; | ||
@@ -11,3 +11,3 @@ { | ||
"devDependencies": { | ||
"tap": "12.1.0" | ||
"tap": "12.1.1" | ||
}, | ||
@@ -32,3 +32,3 @@ "keywords": [ | ||
}, | ||
"version": "1.3.0" | ||
"version": "1.4.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
19248
18
449