UNPKG

1.98 kBTypeScriptView Raw
1import { Route } from '../types/routing';
2import reduct = require('reduct');
3import { CcpRouteControlRequest, CcpRouteUpdateRequest } from 'ilp-protocol-ccp';
4export default class RouteBroadcaster {
5 private deps;
6 private localRoutingTable;
7 private forwardingRoutingTable;
8 private accounts;
9 private config;
10 private peers;
11 private localRoutes;
12 private routingSecret;
13 private untrackCallbacks;
14 constructor(deps: reduct.Injector);
15 start(): void;
16 stop(): void;
17 track(accountId: string): void;
18 untrack(accountId: string): void;
19 add(accountId: string): void;
20 remove(accountId: string): void;
21 handleRouteControl(sourceAccount: string, routeControl: CcpRouteControlRequest): void;
22 handleRouteUpdate(sourceAccount: string, routeUpdate: CcpRouteUpdateRequest): void;
23 reloadLocalRoutes(): void;
24 updatePrefix(prefix: string): boolean;
25 getBestPeerForPrefix(prefix: string): Route | undefined;
26 getGlobalPrefix(): "test" | "g";
27 getStatus(): {
28 routingTableId: string;
29 currentEpoch: number;
30 localRoutingTable: {
31 [x: string]: {
32 auth: undefined;
33 path: string;
34 nextHop: string;
35 };
36 };
37 forwardingRoutingTable: {
38 [x: string]: {
39 auth: undefined;
40 path: string;
41 nextHop: string;
42 } | null;
43 };
44 routingLog: ({
45 route: {
46 auth: undefined;
47 path: string;
48 nextHop: string;
49 } | null | undefined;
50 } | {
51 route: {
52 auth: undefined;
53 path: string;
54 nextHop: string;
55 } | null | undefined;
56 epoch: number;
57 prefix: string;
58 })[];
59 peers: {};
60 };
61 private updateLocalRoute;
62 private updateForwardingRoute;
63 private getAccountRelation;
64}