UNPKG

1.04 kBTypeScriptView Raw
1import { IncomingRoute } from '../types/routing';
2import { CcpRouteUpdateRequest } from 'ilp-protocol-ccp';
3import { PluginInstance } from '../types/plugin';
4export interface CcpReceiverOpts {
5 plugin: PluginInstance;
6 accountId: string;
7}
8export default class CcpReceiver {
9 private plugin;
10 private log;
11 private accountId;
12 private routes;
13 private expiry;
14 private routingTableId;
15 private epoch;
16 constructor({ plugin, accountId }: CcpReceiverOpts);
17 bump(holdDownTime: number): void;
18 getAccountId(): string;
19 getExpiry(): number;
20 getPrefixes(): string[];
21 getRoutingTableId(): string;
22 getEpoch(): number;
23 getStatus(): {
24 routingTableId: string;
25 epoch: number;
26 };
27 handleRouteUpdate({ speaker, routingTableId, fromEpochIndex, toEpochIndex, holdDownTime, newRoutes, withdrawnRoutes }: CcpRouteUpdateRequest): string[];
28 getPrefix(prefix: string): IncomingRoute | undefined;
29 sendRouteControl: () => void;
30 private addRoute;
31 private deleteRoute;
32}