chia-agent
Version:
chia rpc/websocket client library
37 lines (36 loc) • 2 kB
TypeScript
import { str } from "../../chia/types/_python_types_";
import { int, uint64 } from "../../chia_rs/wheel/python/sized_ints";
import { bytes32 } from "../../chia_rs/wheel/python/sized_bytes";
import { TRPCAgent } from "../../../rpc/index";
import { TDaemon } from "../../../daemon/index";
import { GetMessageType, ResType } from "../../types";
export declare const chia_crawler_service = "chia_crawler";
export type chia_crawler_service = typeof chia_crawler_service;
export declare const get_peer_counts_command = "get_peer_counts";
export type get_peer_counts_command = typeof get_peer_counts_command;
export type TGetPeerCountsResponse = {
peer_counts: {
total_last_5_days: int;
reliable_nodes: int;
ipv4_last_5_days: bytes32;
ipv6_last_5_days: uint64;
versions: Record<str, int>;
};
};
export type WsGetPeerCountsMessage = GetMessageType<chia_crawler_service, get_peer_counts_command, TGetPeerCountsResponse>;
export declare function get_peer_counts<T extends TRPCAgent | TDaemon>(agent: T): Promise<ResType<T, TGetPeerCountsResponse, WsGetPeerCountsMessage>>;
export declare const get_ips_after_timestamp_command = "get_ips_after_timestamp";
export type get_ips_after_timestamp_command = typeof get_ips_after_timestamp_command;
export type TGetIpsAfterTimestampRequest = {
after: int;
offset?: int;
limit?: int;
};
export type TGetIpsAfterTimestampResponse = {
ips: str[];
total: int;
};
export type WsGetIpsAfterTimestampMessage = GetMessageType<chia_crawler_service, get_ips_after_timestamp_command, TGetIpsAfterTimestampResponse>;
export declare function get_ips_after_timestamp<T extends TRPCAgent | TDaemon>(agent: T, params: TGetIpsAfterTimestampRequest): Promise<ResType<T, TGetIpsAfterTimestampResponse, WsGetIpsAfterTimestampMessage>>;
export type RpcCrawlerMessage = TGetIpsAfterTimestampResponse | TGetPeerCountsResponse;
export type RpcCrawlerMessageOnWs = WsGetIpsAfterTimestampMessage | WsGetPeerCountsMessage;