import { type ChannelEntry } from '@hoprnet/hopr-core-ethereum'; import { type AcknowledgedTicket } from '@hoprnet/hopr-utils'; import BN from 'bn.js'; import { StrategyTickResult } from '../lib/core_strategy.js'; export { StrategyTickResult } from '../lib/core_strategy.js'; import { ChannelStatus } from '@hoprnet/hopr-utils'; declare const STRATEGIES: string[]; export type Strategy = typeof STRATEGIES[number]; export declare function isStrategy(str: string): str is Strategy; export interface OutgoingChannelStatus { peer_id: string; stake_str: string; status: ChannelStatus; } /** * Staked nodes will likely want to automate opening and closing of channels. By * implementing the following interface, they can decide how to allocate their * stake to best attract traffic with a useful channel graph. * * Implementors should bear in mind: * - Churn is expensive * - Path finding will prefer high stakes, and high availability of nodes. */ export interface ChannelStrategyInterface { name: string; configure(settings: any): void; tick(balance: BN, network_peer_ids: Iterator, outgoing_channel: OutgoingChannelStatus[], peer_quality: (string: string) => number): StrategyTickResult; onChannelWillClose(channel: ChannelEntry): Promise; onAckedTicket(t: AcknowledgedTicket): Promise; shouldCommitToChannel(c: ChannelEntry): boolean; tickInterval: number; } export declare abstract class SaneDefaults { protected autoRedeemTickets: boolean; onAckedTicket(ackTicket: AcknowledgedTicket): Promise; /** * When an incoming channel is going to be closed, auto redeem tickets * @param channel channel that will be closed */ onChannelWillClose(channel: ChannelEntry): Promise; shouldCommitToChannel(c: ChannelEntry): boolean; tickInterval: number; } export declare class StrategyFactory { static getStrategy(strategy: Strategy): ChannelStrategyInterface; } //# sourceMappingURL=channel-strategy.d.ts.map