import { Principal } from '@icp-sdk/core/principal';
export interface CreateInstanceRequest {
    nns?: NnsSubnetConfig;
    sns?: SnsSubnetConfig;
    ii?: IiSubnetConfig;
    fiduciary?: FiduciarySubnetConfig;
    bitcoin?: BitcoinSubnetConfig;
    system?: SystemSubnetConfig[];
    application?: ApplicationSubnetConfig[];
    verifiedApplication?: VerifiedApplicationSubnetConfig[];
    processingTimeoutMs?: number;
    nonmainnetFeatures?: boolean;
}
export interface SubnetConfig<T extends NewSubnetStateConfig | FromPathSubnetStateConfig = NewSubnetStateConfig | FromPathSubnetStateConfig> {
    enableDeterministicTimeSlicing?: boolean;
    enableBenchmarkingInstructionLimits?: boolean;
    state: T;
}
export type NnsSubnetConfig = SubnetConfig<NnsSubnetStateConfig>;
export type NnsSubnetStateConfig = NewSubnetStateConfig | FromPathSubnetStateConfig;
export type SnsSubnetConfig = SubnetConfig<SnsSubnetStateConfig>;
export type SnsSubnetStateConfig = NewSubnetStateConfig;
export type IiSubnetConfig = SubnetConfig<IiSubnetStateConfig>;
export type IiSubnetStateConfig = NewSubnetStateConfig;
export type FiduciarySubnetConfig = SubnetConfig<FiduciarySubnetStateConfig>;
export type FiduciarySubnetStateConfig = NewSubnetStateConfig;
export type BitcoinSubnetConfig = SubnetConfig<BitcoinSubnetStateConfig>;
export type BitcoinSubnetStateConfig = NewSubnetStateConfig;
export type SystemSubnetConfig = SubnetConfig<SystemSubnetStateConfig>;
export type SystemSubnetStateConfig = NewSubnetStateConfig;
export type ApplicationSubnetConfig = SubnetConfig<ApplicationSubnetStateConfig>;
export type ApplicationSubnetStateConfig = NewSubnetStateConfig;
export type VerifiedApplicationSubnetConfig = SubnetConfig<VerifiedApplicationSubnetStateConfig>;
export type VerifiedApplicationSubnetStateConfig = NewSubnetStateConfig;
export interface NewSubnetStateConfig {
    type: SubnetStateType.New;
}
export interface FromPathSubnetStateConfig {
    type: SubnetStateType.FromPath;
    path: string;
}
export declare enum SubnetStateType {
    New = "new",
    FromPath = "fromPath"
}
export interface EncodedCreateInstanceRequest {
    subnet_config_set: EncodedCreateInstanceSubnetConfig;
    nonmainnet_features: boolean;
}
export interface EncodedCreateInstanceSubnetConfig {
    nns?: EncodedSubnetConfig;
    sns?: EncodedSubnetConfig;
    ii?: EncodedSubnetConfig;
    fiduciary?: EncodedSubnetConfig;
    bitcoin?: EncodedSubnetConfig;
    system: EncodedSubnetConfig[];
    application: EncodedSubnetConfig[];
    verified_application: EncodedSubnetConfig[];
}
export interface EncodedSubnetConfig {
    dts_flag: 'Enabled' | 'Disabled';
    instruction_config: 'Production' | 'Benchmarking';
    state_config: 'New' | {
        FromPath: string;
    };
}
export declare function encodeCreateInstanceRequest(req?: CreateInstanceRequest): EncodedCreateInstanceRequest;
export interface GetPubKeyRequest {
    subnetId: Principal;
}
export interface EncodedGetPubKeyRequest {
    subnet_id: string;
}
export declare function encodeGetPubKeyRequest(req: GetPubKeyRequest): EncodedGetPubKeyRequest;
export type InstanceTopology = Record<string, SubnetTopology>;
export interface SubnetTopology {
    id: Principal;
    type: SubnetType;
    size: number;
    canisterRanges: Array<{
        start: Principal;
        end: Principal;
    }>;
}
export declare enum SubnetType {
    Application = "Application",
    Bitcoin = "Bitcoin",
    Fiduciary = "Fiduciary",
    InternetIdentity = "II",
    NNS = "NNS",
    SNS = "SNS",
    System = "System"
}
export interface EncodedGetTopologyResponse {
    subnet_configs: Record<string, EncodedSubnetTopology>;
    default_effective_canister_id: {
        canister_id: string;
    };
}
export interface EncodedSubnetTopology {
    subnet_kind: EncodedSubnetKind;
    size: number;
    canister_ranges: Array<{
        start: {
            canister_id: string;
        };
        end: {
            canister_id: string;
        };
    }>;
}
export type EncodedSubnetKind = 'Application' | 'Bitcoin' | 'Fiduciary' | 'II' | 'NNS' | 'SNS' | 'System';
export declare function decodeGetTopologyResponse(encoded: EncodedGetTopologyResponse): InstanceTopology;
export declare function decodeSubnetTopology(subnetId: string, encoded: EncodedSubnetTopology): SubnetTopology;
export declare function decodeSubnetKind(kind: EncodedSubnetKind): SubnetType;
export interface CreateInstanceSuccessResponse {
    Created: {
        instance_id: number;
        topology: EncodedGetTopologyResponse;
    };
}
export interface CreateInstanceErrorResponse {
    Error: {
        message: string;
    };
}
export type CreateInstanceResponse = CreateInstanceSuccessResponse | CreateInstanceErrorResponse;
export interface GetControllersRequest {
    canisterId: Principal;
}
export interface EncodedGetControllersRequest {
    canister_id: string;
}
export declare function encodeGetControllersRequest(req: GetControllersRequest): EncodedGetControllersRequest;
export type GetControllersResponse = Principal[];
export type EncodedGetControllersResponse = {
    principal_id: string;
}[];
export declare function decodeGetControllersResponse(res: EncodedGetControllersResponse): GetControllersResponse;
export interface GetTimeResponse {
    millisSinceEpoch: number;
}
export interface EncodedGetTimeResponse {
    nanos_since_epoch: number;
}
export declare function decodeGetTimeResponse(res: EncodedGetTimeResponse): GetTimeResponse;
export interface SetTimeRequest {
    millisSinceEpoch: number;
}
export interface EncodedSetTimeRequest {
    nanos_since_epoch: number;
}
export declare function encodeSetTimeRequest(req: SetTimeRequest): EncodedSetTimeRequest;
export interface GetSubnetIdRequest {
    canisterId: Principal;
}
export interface EncodedGetSubnetIdRequest {
    canister_id: string;
}
export declare function encodeGetSubnetIdRequest(req: GetSubnetIdRequest): EncodedGetSubnetIdRequest;
export type GetSubnetIdResponse = {
    subnetId: Principal | null;
};
export type EncodedGetSubnetIdResponse = {
    subnet_id: string;
} | {};
export declare function decodeGetSubnetIdResponse(res: EncodedGetSubnetIdResponse): GetSubnetIdResponse;
export interface GetCyclesBalanceRequest {
    canisterId: Principal;
}
export interface EncodedGetCyclesBalanceRequest {
    canister_id: string;
}
export declare function encodeGetCyclesBalanceRequest(req: GetCyclesBalanceRequest): EncodedGetCyclesBalanceRequest;
export interface EncodedGetCyclesBalanceResponse {
    cycles: number;
}
export interface GetCyclesBalanceResponse {
    cycles: number;
}
export declare function decodeGetCyclesBalanceResponse(res: EncodedGetCyclesBalanceResponse): GetCyclesBalanceResponse;
export interface AddCyclesRequest {
    canisterId: Principal;
    amount: number;
}
export interface EncodedAddCyclesRequest {
    canister_id: string;
    amount: number;
}
export declare function encodeAddCyclesRequest(req: AddCyclesRequest): EncodedAddCyclesRequest;
export interface AddCyclesResponse {
    cycles: number;
}
export interface EncodedAddCyclesResponse {
    cycles: number;
}
export declare function decodeAddCyclesResponse(res: EncodedAddCyclesResponse): AddCyclesResponse;
export interface UploadBlobRequest {
    blob: Uint8Array;
}
export type EncodedUploadBlobRequest = Uint8Array;
export declare function encodeUploadBlobRequest(req: UploadBlobRequest): EncodedUploadBlobRequest;
export interface UploadBlobResponse {
    blobId: Uint8Array;
}
export type EncodedUploadBlobResponse = string;
export declare function decodeUploadBlobResponse(res: EncodedUploadBlobResponse): UploadBlobResponse;
export interface SetStableMemoryRequest {
    canisterId: Principal;
    blobId: Uint8Array;
}
export interface EncodedSetStableMemoryRequest {
    canister_id: string;
    blob_id: string;
}
export declare function encodeSetStableMemoryRequest(req: SetStableMemoryRequest): EncodedSetStableMemoryRequest;
export interface GetStableMemoryRequest {
    canisterId: Principal;
}
export interface EncodedGetStableMemoryRequest {
    canister_id: string;
}
export declare function encodeGetStableMemoryRequest(req: GetStableMemoryRequest): EncodedGetStableMemoryRequest;
export interface GetStableMemoryResponse {
    blob: Uint8Array;
}
export interface EncodedGetStableMemoryResponse {
    blob: string;
}
export declare function decodeGetStableMemoryResponse(res: EncodedGetStableMemoryResponse): GetStableMemoryResponse;
export interface GetPendingHttpsOutcallsResponse {
    subnetId: Principal;
    requestId: number;
    httpMethod: CanisterHttpMethod;
    url: string;
    headers: CanisterHttpHeader[];
    body: Uint8Array;
    maxResponseBytes?: number;
}
export declare enum CanisterHttpMethod {
    GET = "GET",
    POST = "POST",
    HEAD = "HEAD"
}
export type CanisterHttpHeader = [string, string];
export interface EncodedGetPendingHttpsOutcallsResponse {
    subnet_id: {
        subnet_id: string;
    };
    request_id: number;
    http_method: EncodedCanisterHttpMethod;
    url: string;
    headers: EncodedCanisterHttpHeader[];
    body: string;
    max_response_bytes?: number;
}
export declare enum EncodedCanisterHttpMethod {
    GET = "GET",
    POST = "POST",
    HEAD = "HEAD"
}
export interface EncodedCanisterHttpHeader {
    name: string;
    value: string;
}
export declare function decodeGetPendingHttpsOutcallsResponse(res: EncodedGetPendingHttpsOutcallsResponse[]): GetPendingHttpsOutcallsResponse[];
export interface MockPendingHttpsOutcallRequest {
    subnetId: Principal;
    requestId: number;
    response: HttpsOutcallResponseMock;
    additionalResponses: HttpsOutcallResponseMock[];
}
export type HttpsOutcallResponseMock = HttpsOutcallSuccessResponseMock | HttpsOutcallRejectResponseMock;
export interface HttpsOutcallSuccessResponseMock {
    type: 'success';
    statusCode: number;
    headers: CanisterHttpHeader[];
    body: Uint8Array;
}
export interface HttpsOutcallRejectResponseMock {
    type: 'reject';
    statusCode: number;
    message: string;
}
export interface EncodedMockPendingHttpsOutcallRequest {
    subnet_id: {
        subnet_id: string;
    };
    request_id: number;
    response: EncodedHttpsOutcallResponseMock;
    additional_responses: EncodedHttpsOutcallResponseMock[];
}
export type EncodedHttpsOutcallResponseMock = EncodedHttpsOutcallSuccessResponseMock | EncodedHttpsOutcallRejectResponseMock;
export interface EncodedHttpsOutcallSuccessResponseMock {
    CanisterHttpReply: {
        status: number;
        headers: EncodedCanisterHttpHeader[];
        body: string;
    };
}
export interface EncodedHttpsOutcallRejectResponseMock {
    CanisterHttpReject: {
        reject_code: number;
        message: string;
    };
}
export declare function encodeMockPendingHttpsOutcallRequest(req: MockPendingHttpsOutcallRequest): EncodedMockPendingHttpsOutcallRequest;
export interface CanisterCallRequest {
    sender: Principal;
    canisterId: Principal;
    method: string;
    payload: Uint8Array;
    effectivePrincipal?: EffectivePrincipal;
}
export type EffectivePrincipal = {
    subnetId: Principal;
} | {
    canisterId: Principal;
};
export interface EncodedCanisterCallRequest {
    sender: string;
    canister_id: string;
    method: string;
    payload: string;
    effective_principal?: EncodedEffectivePrincipal;
}
export type EncodedEffectivePrincipal = {
    SubnetId: string;
} | {
    CanisterId: string;
} | 'None';
export declare function encodeEffectivePrincipal(effectivePrincipal?: EffectivePrincipal | null): EncodedEffectivePrincipal;
export declare function decodeEffectivePrincipal(effectivePrincipal: EncodedEffectivePrincipal): EffectivePrincipal | null;
export declare function encodeCanisterCallRequest(req: CanisterCallRequest): EncodedCanisterCallRequest;
export type EncodedCanisterCallResult<T> = {
    Ok: T;
} | {
    Err: EncodedCanisterCallRejectResponse;
};
export interface EncodedCanisterCallRejectResponse {
    reject_code: number;
    reject_message: string;
    error_code: number;
    certified: boolean;
}
export interface CanisterCallResponse {
    body: Uint8Array;
}
export type EncodedCanisterCallResponse = EncodedCanisterCallResult<string>;
export declare function decodeCanisterCallResponse(res: EncodedCanisterCallResponse): CanisterCallResponse;
export type SubmitCanisterCallRequest = CanisterCallRequest;
export type EncodedSubmitCanisterCallRequest = EncodedCanisterCallRequest;
export declare function encodeSubmitCanisterCallRequest(req: SubmitCanisterCallRequest): EncodedSubmitCanisterCallRequest;
export interface SubmitCanisterCallResponse {
    effectivePrincipal: EffectivePrincipal | null;
    messageId: Uint8Array;
}
export interface EncodedCanisterCallId {
    effective_principal: EncodedEffectivePrincipal;
    message_id: Uint8Array;
}
export type EncodedSubmitCanisterCallResponse = EncodedCanisterCallResult<EncodedCanisterCallId>;
export declare function decodeSubmitCanisterCallResponse(res: EncodedSubmitCanisterCallResponse): SubmitCanisterCallResponse;
export interface IngressStatusRequest {
    messageId: EncodedCanisterCallId;
    caller?: Principal;
}
export interface EncodedIngressStatusRequest {
    raw_message_id: EncodedCanisterCallId;
    raw_caller?: string;
}
export declare function encodeIngressStatusRequest(req: IngressStatusRequest): EncodedIngressStatusRequest;
export type IngressStatusResponse = CanisterCallResponse;
export type EncodedIngressStatusResponse = EncodedCanisterCallResponse | {};
export declare function decodeIngressStatusResponse(res: EncodedIngressStatusResponse): IngressStatusResponse | null;
export type AwaitCanisterCallRequest = SubmitCanisterCallResponse;
export type EncodedAwaitCanisterCallRequest = EncodedCanisterCallId;
export declare function encodeAwaitCanisterCallRequest(req: AwaitCanisterCallRequest): EncodedAwaitCanisterCallRequest;
export type AwaitCanisterCallResponse = CanisterCallResponse;
