/// <reference types="node" />
import { FailoverStrategy } from "../blockchainClient/enums";
import { ClientConfig, Endpoint } from "../blockchainClient/types";
import { RawGtv } from "../gtv/types";
import { SignerPair } from "../gtx/types";
import { StringPath } from "../merkle/types";
import { Method } from "./enums";
export type RestClientConfig = {
    endpointPool: Endpoint[];
    pool: {
        maxSockets: number;
    };
    pollingInterval: number;
    failoverStrategy: FailoverStrategy;
    attemptsPerEndpoint: number;
    attemptInterval: number;
    unreachableDuration: number;
};
export type RequestOptions = {
    method: string;
    url: string;
    json: boolean;
    body?: object;
    pool: {
        maxSockets: number;
    };
};
export type QueryObject = {
    type: string;
    [arg: string]: RawGtv;
};
export type QueryObjectGTV = [name: string, args: Arg];
export type Arg = {
    [arg: string]: RawGtv;
};
export type ServerReturnProof = {
    hash: string;
    blockHeader: string;
    signatures: SignerPair[];
    merklePath: StringPath;
};
export declare enum ResponseStatus {
    Confirmed = "confirmed",
    Rejected = "rejected",
    Unknown = "unknown",
    Waiting = "waiting"
}
export type TransactionObject = {
    tx: string;
};
export type StatusObject = {
    status: ResponseStatus;
    rejectReason?: string;
};
export type PostRequestObjects = TransactionObject | QueryObject;
export type GetResponseObjects = StatusObject | TransactionObject | ServerReturnProof;
export type FailOverConfig = {
    strategy?: FailoverStrategy;
    attemptsPerEndpoint?: number;
    attemptInterval?: number;
    unreachableDuration?: number;
};
export type ResponseObject<TBody = any, TError = Error> = {
    statusCode: number | null;
} & ({
    error: TError;
    rspBody: never;
} | {
    error: null;
    rspBody: TBody;
});
export type RetryRequestSettings = {
    endpointPool: Endpoint[];
    attemptsPerEndpoint: number;
    unreachableDuration: number;
    attemptInterval: number;
};
export interface BaseRequestProps {
    method: Method;
    path: string;
    postObject?: PostRequestObjects | Buffer;
}
export interface HandleRequestInputProps extends BaseRequestProps {
    config: RestClientConfig | Omit<ClientConfig, "blockchainRid">;
}
export interface RetryRequestProps extends BaseRequestProps {
    config: RetryRequestSettings;
}
export type RestClientCallback<TData, TError = Error> = (error: TError | null | undefined, responseBody: TData | null | undefined) => void;
