New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bolt07

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bolt07 - npm Package Compare versions

Comparing version 1.4.5 to 1.5.0

CHANGELOG.md

13

index.js

@@ -1,6 +0,7 @@

const {chanFormat} = require('./lib');
const {chanNumber} = require('./lib');
const {decodeChanId} = require('./lib');
const {encodeChanId} = require('./lib');
const {rawChanId} = require('./lib');
const {chanFormat} = require('./ids');
const {chanNumber} = require('./ids');
const {decodeChanId} = require('./ids');
const {encodeChanId} = require('./ids');
const {rawChanId} = require('./ids');
const {routeFromChannels} = require('./routing');

@@ -13,3 +14,3 @@ module.exports = {

rawChanId,
routeFromChannels,
};

@@ -14,3 +14,3 @@ {

"devDependencies": {
"tap": "14.10.6"
"tap": "14.10.7"
},

@@ -33,5 +33,5 @@ "keywords": [

"scripts": {
"test": "tap test/*.js"
"test": "tap test/ids/*.js test/routing/*.js"
},
"version": "1.4.5"
"version": "1.5.0"
}

@@ -65,3 +65,3 @@ # BOLT07

### Decode Chan Id
### decodeChanId

@@ -105,3 +105,3 @@ Returns components of a channel id or channel number.

### Encode Chan Id
### encodeChanId

@@ -153,1 +153,151 @@ Returns channel id when components are specified

## Methods
### chanFormat
Get channel components formatted string
{
[id]: <Raw Channel Id String>
[number]: <Number Format Channel Id String>
}
@throws
<Error>
@returns
{
channel: <Components Channel Format String>
}
### chanNumber
Channel id in numeric format
{
[channel]: <Channel Components String>
[id]: <Channel Id Hex String>
}
@throws
<ExpectedChannelIdOrComponentsToConvertToNumber Error>
@returns
{
number: <Channel Id Number String>
}
### decodeChanId
Decode a short channel id into components
{
[channel]: <Channel Components String>
[id]: <Channel Id Hex String>
[number]: <Channel Id Number Format String>
}
@throws
<ExpectedShortChannelIdToDecode Error>
<UnexpectedErrorDecodingChannelIdNumber Error>
<UnexpectedLengthOfShortChannelId Error>
@returns
{
block_height: <Channel Funding Transaction Inclusion Block Height Number>
block_index: <Channel Funding Transaction Inclusion Block Position Number>
output_index: <Channel Funding Transaction Output Index Number>
}
### encodeChanId
Encode a short channel id from components
{
block_height: <Channel Funding Transaction Inclusion Block Height Number>
block_index: <Channel Funding Transaction Inclusion Block Position Number>
output_index: <Channel Funding Transaction Output Index Number>
}
@throws
<ExpectedBlockHeightForChannelId Error>
<ExpectedBlockIndexForChannelId Error>
<ExpectedTransactionOutputIndexForChannelId Error>
@returns
{
channel: <Channel Components Format String>
id: <Channel Id Hex String>
number: <Channel Number String>
}
### rawChanId
Raw channel id
{
[channel]: <Channel Components String>
[number]: <Channel Id In Number Format String>
}
@throws
<Error>
@returns
{
id: <Raw Channel Id Hex String>
}
### routeFromChannels
Get a route from a sequence of channels
Either next hop destination in channels or final destination is required
{
channels: [{
capacity: <Maximum Tokens Number>
[destination]: <Next Node Public Key Hex String>
id: <Standard Format Channel Id String>
policies: [{
base_fee_mtokens: <Base Fee Millitokens String>
cltv_delta: <Locktime Delta Number>
fee_rate: <Fees Charged Per Million Tokens Number>
is_disabled: <Channel Is Disabled Bool>
min_htlc_mtokens: <Minimum HTLC Millitokens Value String>
public_key: <Node Public Key String>
}]
}]
[cltv_delta]: <Final CLTV Delta Number>
[destination]: <Destination Public Key Hex String>
height: <Current Block Height Number>
mtokens: <Millitokens To Send String>
[payment]: <Payment Identification Value Hex String>
[total_mtokens]: <Sum of Shards Millitokens String>
}
@throws
<Error>
@returns
{
route: {
fee: <Total Fee Tokens To Pay Number>
fee_mtokens: <Total Fee Millitokens To Pay String>
hops: [{
channel: <Standard Format Channel Id String>
channel_capacity: <Channel Capacity Tokens Number>
fee: <Fee Number>
fee_mtokens: <Fee Millitokens String>
forward: <Forward Tokens Number>
forward_mtokens: <Forward Millitokens String>
[public_key]: <Public Key Hex String>
timeout: <Timeout Block Height Number>
}]
mtokens: <Total Fee-Inclusive Millitokens String>
[payment]: <Payment Identification Value Hex String>
timeout: <Timeout Block Height Number>
tokens: <Total Fee-Inclusive Tokens Number>
[total_mtokens]: <Sum of Shards Millitokens String>
}
}
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