import { BigNumber } from "bignumber.js" ; import { AssetID } from "../../model" ; import { Offer } from "../../orm/entities/offer" ; import { OffersGraph } from "./offers_graph" ; import { load as loadOrderBook } from "./orderbook" ; import { PathFinder } from "./path_finder" ; const offersGraph = new OffersGraph ( ) ; export * from "./offers_listener" ; export function buildOffersGraph ( offers ) { offersGraph . build ( offers ) ; } export function updateOffersGraph ( selling , buying , offers ) { offersGraph . update ( selling , buying , offers ) ; } export function findPaymentPaths ( sourceAssets , destAsset , destAmount ) { const pathFinder = new PathFinder ( offersGraph ) ; return pathFinder . findPaths ( sourceAssets , destAsset , destAmount ) ; } export const orderBook = { load : loadOrderBook } ;