Skip to content

Commit

Permalink
export hops from channels method
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbosworth committed Feb 12, 2021
1 parent c0aec5d commit ab48841
Show file tree
Hide file tree
Showing 7 changed files with 179 additions and 125 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# Versions

## 1.7.0

- `hopsFromChannels`: Derive policy hops from a list of channels

## 1.6.0

- `routeFromChannels`: Add support for `messages` in routes
Expand Down
11 changes: 11 additions & 0 deletions README.md
Expand Up @@ -6,6 +6,17 @@ Utilities for working with Lightning Network [BOLT 07](https://github.com/lightn
[![Coverage Status](https://coveralls.io/repos/github/alexbosworth/bolt07/badge.svg?branch=master)](https://coveralls.io/github/alexbosworth/bolt07?branch=master)
[![Build Status](https://travis-ci.org/alexbosworth/bolt07.svg?branch=master)](https://travis-ci.org/alexbosworth/bolt07)

## Methods

- [chanFormat](#chanformat) - convert number or raw bytes format channel id to standard format
- [chanNumber](#channumber) - convert standard, raw bytes format channel id to number format
- [decodeChanId](#decodechanid) - decode block height and index components of a channel id
- [encodeChanId](#encodechanid) - encode block height and index components into a channel id
- [hopsFromChannels](#hopsfromchannels) - derive policy hops from a list of channels
- [rawChanId](#rawchanid) - convert numeric or standard channel id into a raw wire form
- [routeFromChannels](#routefromchannels) - derive a route from a sequence of channels
- [routeFromHops](#routefromhops) - derive a route from a sequence of policy hops

## Examples

Sample code for working with bolt07 utility functions:
Expand Down
2 changes: 2 additions & 0 deletions index.js
Expand Up @@ -2,6 +2,7 @@ const {chanFormat} = require('./ids');
const {chanNumber} = require('./ids');
const {decodeChanId} = require('./ids');
const {encodeChanId} = require('./ids');
const {hopsFromChannels} = require('./routing');
const {rawChanId} = require('./ids');
const {routeFromChannels} = require('./routing');
const {routeFromHops} = require('./routing');
Expand All @@ -11,6 +12,7 @@ module.exports = {
chanNumber,
decodeChanId,
encodeChanId,
hopsFromChannels,
rawChanId,
routeFromChannels,
routeFromHops,
Expand Down

0 comments on commit ab48841

Please sign in to comment.