five-bells-routing
v4.0.0
Published
ILP routing layer utilities
Downloads
347
Maintainers
Readme
five-bells-routing
ILP routing table implementation
API Reference
Route
RouteData
refers to the Routes schema in five-bells-shared.
new Route(curve, hops, info)
Route.fromData(routeData) ⇒ Route
route.amountAt(x) ⇒ Number
Given a source amount, look up the corresponding destination amount.
route.amountReverse(y) ⇒ Number
Given a destination amount, look up the corresponding source amount.
route.getPoints(y) ⇒ Point[]
route.combine(alternateRoute) ⇒ Route
Combine two parallel routes.
route.join(tailRoute) ⇒ Route
Join two routes end-to-end.
route.shiftY(dy) ⇒ Route
Shift a route's curve up or down.
route.simplify(maxPoints) ⇒ Route
Simplify a route.
route.isExpired() ⇒ Boolean
Check if a route has expired.
route.toJSON() ⇒ RouteData
RoutingTables
new RoutingTables(baseURI, localRoutes, expiryDuration)
tables.addLocalRoutes(localRouteObjects)
tables.addRoute(routeObject) ⇒ Boolean
Returns whether or not a new route was created (updates don't count).