UNPKG

1.41 kBTypeScriptView Raw
1import ForwardingRoutingTable from '../services/forwarding-routing-table';
2import { Relation } from './relation';
3import { CcpRouteControlRequest, Mode } from 'ilp-protocol-ccp';
4import { PluginInstance } from '../types/plugin';
5export interface CcpSenderOpts {
6 accountId: string;
7 plugin: PluginInstance;
8 forwardingRoutingTable: ForwardingRoutingTable;
9 getOwnAddress: () => string;
10 getAccountRelation: (accountId: string) => Relation;
11 routeExpiry: number;
12 routeBroadcastInterval: number;
13}
14export default class CcpSender {
15 private plugin;
16 private forwardingRoutingTable;
17 private log;
18 private accountId;
19 private mode;
20 private getOwnAddress;
21 private getAccountRelation;
22 private routeExpiry;
23 private routeBroadcastInterval;
24 private lastKnownEpoch;
25 private lastUpdate;
26 private sendRouteUpdateTimer?;
27 constructor({ accountId, plugin, forwardingRoutingTable, getOwnAddress, getAccountRelation, routeExpiry, routeBroadcastInterval }: CcpSenderOpts);
28 stop(): void;
29 getAccountId(): string;
30 getLastUpdate(): number;
31 getLastKnownEpoch(): number;
32 getMode(): Mode;
33 getStatus(): {
34 epoch: number;
35 mode: string;
36 };
37 handleRouteControl({ mode, lastKnownRoutingTableId, lastKnownEpoch, features }: CcpRouteControlRequest): void;
38 scheduleRouteUpdate: () => void;
39 private sendSingleRouteUpdate;
40}