import { Agent as HttpsAgent } from "https";
import { Agent as HttpAgent } from "http";
import { TConfig } from "../config/index";
import { APIAgent } from "../agent/index";
export type TRpcErrorCode = "API_ERROR" | "BLOCK_DOES_NOT_EXIST" | "BLOCK_HASH_NOT_FOUND" | "BLOCK_HEIGHT_NOT_FOUND" | "BLOCK_IN_FORK" | "BLOCK_NOT_FOUND" | "COIN_RECORD_NOT_FOUND" | "CONSENSUS_ERROR" | "EOS_NOT_IN_CACHE" | "HEADER_HASH_NOT_IN_REQUEST" | "HEIGHT_NOT_IN_BLOCKCHAIN" | "HINT_NOT_IN_REQUEST" | "INTERNAL_ERROR" | "INVALID_BLOCK_OR_GENERATOR" | "INVALID_COST" | "INVALID_HEIGHT_FOR_COIN" | "INVALID_NETWORK_SPACE_REQUEST" | "NAME_NOT_IN_REQUEST" | "NAMES_NOT_IN_REQUEST" | "NEW_AND_OLD_MUST_DIFFER" | "NEWER_BLOCK_NOT_FOUND" | "NO_BLOCKS_IN_CHAIN" | "NO_COIN_NAME_IN_REQUEST" | "NO_END_IN_REQUEST" | "NO_HEADER_HASH_IN_REQUEST" | "NO_HEIGHT_IN_REQUEST" | "NO_START_IN_REQUEST" | "NO_TX_ID_IN_REQUEST" | "OLDER_BLOCK_NOT_FOUND" | "PARENT_IDS_NOT_IN_REQUEST" | "PEAK_IS_NONE" | "PROTOCOL_ERROR" | "PUZZLE_HASH_NOT_IN_REQUEST" | "PUZZLE_HASHES_NOT_IN_REQUEST" | "PUZZLE_SOLUTION_FAILED" | "REQUEST_MUST_CONTAIN_EXACTLY_ONE" | "SP_NOT_IN_CACHE" | "SPEND_BUNDLE_NOT_IN_REQUEST" | "TARGET_TIMES_NON_NEGATIVE" | "TARGET_TIMES_REQUIRED" | "TIMESTAMP_ERROR" | "TRANSACTION_FAILED" | "TX_NOT_IN_MEMPOOL" | "UNKNOWN" | "VALIDATION_ERROR";
export type TStructuredError = {
    code: TRpcErrorCode | string;
    message: string;
    data: Record<string, unknown>;
};
export declare class RpcError extends Error {
    response: unknown;
    structuredError?: TStructuredError;
    constructor(message: string, response: unknown);
}
type TDestination = "farmer" | "harvester" | "full_node" | "wallet" | "data_layer" | "solver" | "daemon" | "pool";
export declare function getConnectionInfoFromConfig(destination: TDestination, config: TConfig): {
    hostname: string;
    port: number;
};
export declare function getConf(configPath?: string): TConfig;
export declare function loadCertFilesFromConfig(config: TConfig): {
    clientCert: Buffer;
    clientKey: Buffer;
    caCert: Buffer;
};
export type TRPCAgentProps = {
    protocol: "https";
    host: string;
    port: number;
    ca_cert?: string | Buffer;
    client_cert?: string | Buffer;
    client_key?: string | Buffer;
    skip_hostname_verification?: boolean;
    keepAlive?: boolean;
    keepAliveMsecs?: number;
    maxSockets?: number;
    timeout?: number;
} | {
    protocol: "https";
    host: string;
    port: number;
    configPath: string;
    skip_hostname_verification?: boolean;
    keepAlive?: boolean;
    keepAliveMsecs?: number;
    maxSockets?: number;
    timeout?: number;
} | {
    protocol: "http";
    host: string;
    port: number;
    keepAlive?: boolean;
    keepAliveMsecs?: number;
    maxSockets?: number;
    timeout?: number;
} | {
    service: TDestination;
    host?: string;
    port?: number;
    configPath?: string;
    skip_hostname_verification?: boolean;
    keepAlive?: boolean;
    keepAliveMsecs?: number;
    maxSockets?: number;
    timeout?: number;
} | {
    httpsAgent: HttpsAgent;
    skip_hostname_verification?: boolean;
} | {
    httpAgent: HttpAgent;
    host: string;
    port: number;
    skip_hostname_verification?: boolean;
};
export declare class RPCAgent implements APIAgent {
    protected _protocol: "http" | "https";
    protected _agent: HttpsAgent | HttpAgent;
    protected _skip_hostname_verification: boolean;
    protected _host: string;
    protected _port: number;
    constructor(props: TRPCAgentProps);
    sendMessage<M>(destination: string, command: string, data?: Record<string, unknown>): Promise<M>;
    request<R>(method: string, path: string, data?: any): Promise<R>;
}
export type TRPCAgent = APIAgent;
export {};
