chia-agent
Version:
chia rpc/websocket client library
30 lines (29 loc) • 1.72 kB
TypeScript
import { bytes32 } from "../../chia_rs/wheel/python/sized_bytes";
import { str } from "../../chia/types/_python_types_";
import { int, uint64 } from "../../chia_rs/wheel/python/sized_ints";
import { TDaemon } from "../../../daemon/index";
import { GetMessageType } from "../../types";
export declare const chia_crawler_service = "chia_crawler";
export type chia_crawler_service = typeof chia_crawler_service;
export type TPeerCounts = {
total_last_5_days: int;
reliable_nodes: int;
ipv4_last_5_days: bytes32;
ipv6_last_5_days: uint64;
versions: Record<str, int>;
};
export declare const loaded_initial_peers_command = "loaded_initial_peers";
export type loaded_initial_peers_command = typeof loaded_initial_peers_command;
export type TLoadedInitialPeersBroadCast = {
peer_counts: TPeerCounts;
};
export type WsLoadedInitialPeersMessage = GetMessageType<chia_crawler_service, loaded_initial_peers_command, TLoadedInitialPeersBroadCast>;
export declare function on_loaded_initial_peers(daemon: TDaemon, callback: (e: WsLoadedInitialPeersMessage) => unknown): Promise<() => void>;
export declare const crawl_batch_completed_command = "crawl_batch_completed";
export type crawl_batch_completed_command = typeof crawl_batch_completed_command;
export type TCrawlBatchCompletedBroadCast = {
peer_counts: TPeerCounts;
};
export type WsCrawlBatchCompletedMessage = GetMessageType<chia_crawler_service, crawl_batch_completed_command, TCrawlBatchCompletedBroadCast>;
export declare function on_crawl_batch_completed(daemon: TDaemon, callback: (e: WsCrawlBatchCompletedMessage) => unknown): Promise<() => void>;
export type WsCrawlerMessage = WsLoadedInitialPeersMessage | WsCrawlBatchCompletedMessage;