// package: ibc.core.client.v1
// file: ibc/core/client/v1/tx.proto

import * as ibc_core_client_v1_tx_pb from "../../../../ibc/core/client/v1/tx_pb";
import {grpc} from "@improbable-eng/grpc-web";

type MsgCreateClient = {
  readonly methodName: string;
  readonly service: typeof Msg;
  readonly requestStream: false;
  readonly responseStream: false;
  readonly requestType: typeof ibc_core_client_v1_tx_pb.MsgCreateClient;
  readonly responseType: typeof ibc_core_client_v1_tx_pb.MsgCreateClientResponse;
};

type MsgUpdateClient = {
  readonly methodName: string;
  readonly service: typeof Msg;
  readonly requestStream: false;
  readonly responseStream: false;
  readonly requestType: typeof ibc_core_client_v1_tx_pb.MsgUpdateClient;
  readonly responseType: typeof ibc_core_client_v1_tx_pb.MsgUpdateClientResponse;
};

type MsgUpgradeClient = {
  readonly methodName: string;
  readonly service: typeof Msg;
  readonly requestStream: false;
  readonly responseStream: false;
  readonly requestType: typeof ibc_core_client_v1_tx_pb.MsgUpgradeClient;
  readonly responseType: typeof ibc_core_client_v1_tx_pb.MsgUpgradeClientResponse;
};

type MsgSubmitMisbehaviour = {
  readonly methodName: string;
  readonly service: typeof Msg;
  readonly requestStream: false;
  readonly responseStream: false;
  readonly requestType: typeof ibc_core_client_v1_tx_pb.MsgSubmitMisbehaviour;
  readonly responseType: typeof ibc_core_client_v1_tx_pb.MsgSubmitMisbehaviourResponse;
};

type MsgRecoverClient = {
  readonly methodName: string;
  readonly service: typeof Msg;
  readonly requestStream: false;
  readonly responseStream: false;
  readonly requestType: typeof ibc_core_client_v1_tx_pb.MsgRecoverClient;
  readonly responseType: typeof ibc_core_client_v1_tx_pb.MsgRecoverClientResponse;
};

type MsgIBCSoftwareUpgrade = {
  readonly methodName: string;
  readonly service: typeof Msg;
  readonly requestStream: false;
  readonly responseStream: false;
  readonly requestType: typeof ibc_core_client_v1_tx_pb.MsgIBCSoftwareUpgrade;
  readonly responseType: typeof ibc_core_client_v1_tx_pb.MsgIBCSoftwareUpgradeResponse;
};

type MsgUpdateClientParams = {
  readonly methodName: string;
  readonly service: typeof Msg;
  readonly requestStream: false;
  readonly responseStream: false;
  readonly requestType: typeof ibc_core_client_v1_tx_pb.MsgUpdateParams;
  readonly responseType: typeof ibc_core_client_v1_tx_pb.MsgUpdateParamsResponse;
};

export class Msg {
  static readonly serviceName: string;
  static readonly CreateClient: MsgCreateClient;
  static readonly UpdateClient: MsgUpdateClient;
  static readonly UpgradeClient: MsgUpgradeClient;
  static readonly SubmitMisbehaviour: MsgSubmitMisbehaviour;
  static readonly RecoverClient: MsgRecoverClient;
  static readonly IBCSoftwareUpgrade: MsgIBCSoftwareUpgrade;
  static readonly UpdateClientParams: MsgUpdateClientParams;
}

export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
export type Status = { details: string, code: number; metadata: grpc.Metadata }

interface UnaryResponse {
  cancel(): void;
}
interface ResponseStream<T> {
  cancel(): void;
  on(type: 'data', handler: (message: T) => void): ResponseStream<T>;
  on(type: 'end', handler: (status?: Status) => void): ResponseStream<T>;
  on(type: 'status', handler: (status: Status) => void): ResponseStream<T>;
}
interface RequestStream<T> {
  write(message: T): RequestStream<T>;
  end(): void;
  cancel(): void;
  on(type: 'end', handler: (status?: Status) => void): RequestStream<T>;
  on(type: 'status', handler: (status: Status) => void): RequestStream<T>;
}
interface BidirectionalStream<ReqT, ResT> {
  write(message: ReqT): BidirectionalStream<ReqT, ResT>;
  end(): void;
  cancel(): void;
  on(type: 'data', handler: (message: ResT) => void): BidirectionalStream<ReqT, ResT>;
  on(type: 'end', handler: (status?: Status) => void): BidirectionalStream<ReqT, ResT>;
  on(type: 'status', handler: (status: Status) => void): BidirectionalStream<ReqT, ResT>;
}

export class MsgClient {
  readonly serviceHost: string;

  constructor(serviceHost: string, options?: grpc.RpcOptions);
  createClient(
    requestMessage: ibc_core_client_v1_tx_pb.MsgCreateClient,
    metadata: grpc.Metadata,
    callback: (error: ServiceError|null, responseMessage: ibc_core_client_v1_tx_pb.MsgCreateClientResponse|null) => void
  ): UnaryResponse;
  createClient(
    requestMessage: ibc_core_client_v1_tx_pb.MsgCreateClient,
    callback: (error: ServiceError|null, responseMessage: ibc_core_client_v1_tx_pb.MsgCreateClientResponse|null) => void
  ): UnaryResponse;
  updateClient(
    requestMessage: ibc_core_client_v1_tx_pb.MsgUpdateClient,
    metadata: grpc.Metadata,
    callback: (error: ServiceError|null, responseMessage: ibc_core_client_v1_tx_pb.MsgUpdateClientResponse|null) => void
  ): UnaryResponse;
  updateClient(
    requestMessage: ibc_core_client_v1_tx_pb.MsgUpdateClient,
    callback: (error: ServiceError|null, responseMessage: ibc_core_client_v1_tx_pb.MsgUpdateClientResponse|null) => void
  ): UnaryResponse;
  upgradeClient(
    requestMessage: ibc_core_client_v1_tx_pb.MsgUpgradeClient,
    metadata: grpc.Metadata,
    callback: (error: ServiceError|null, responseMessage: ibc_core_client_v1_tx_pb.MsgUpgradeClientResponse|null) => void
  ): UnaryResponse;
  upgradeClient(
    requestMessage: ibc_core_client_v1_tx_pb.MsgUpgradeClient,
    callback: (error: ServiceError|null, responseMessage: ibc_core_client_v1_tx_pb.MsgUpgradeClientResponse|null) => void
  ): UnaryResponse;
  submitMisbehaviour(
    requestMessage: ibc_core_client_v1_tx_pb.MsgSubmitMisbehaviour,
    metadata: grpc.Metadata,
    callback: (error: ServiceError|null, responseMessage: ibc_core_client_v1_tx_pb.MsgSubmitMisbehaviourResponse|null) => void
  ): UnaryResponse;
  submitMisbehaviour(
    requestMessage: ibc_core_client_v1_tx_pb.MsgSubmitMisbehaviour,
    callback: (error: ServiceError|null, responseMessage: ibc_core_client_v1_tx_pb.MsgSubmitMisbehaviourResponse|null) => void
  ): UnaryResponse;
  recoverClient(
    requestMessage: ibc_core_client_v1_tx_pb.MsgRecoverClient,
    metadata: grpc.Metadata,
    callback: (error: ServiceError|null, responseMessage: ibc_core_client_v1_tx_pb.MsgRecoverClientResponse|null) => void
  ): UnaryResponse;
  recoverClient(
    requestMessage: ibc_core_client_v1_tx_pb.MsgRecoverClient,
    callback: (error: ServiceError|null, responseMessage: ibc_core_client_v1_tx_pb.MsgRecoverClientResponse|null) => void
  ): UnaryResponse;
  iBCSoftwareUpgrade(
    requestMessage: ibc_core_client_v1_tx_pb.MsgIBCSoftwareUpgrade,
    metadata: grpc.Metadata,
    callback: (error: ServiceError|null, responseMessage: ibc_core_client_v1_tx_pb.MsgIBCSoftwareUpgradeResponse|null) => void
  ): UnaryResponse;
  iBCSoftwareUpgrade(
    requestMessage: ibc_core_client_v1_tx_pb.MsgIBCSoftwareUpgrade,
    callback: (error: ServiceError|null, responseMessage: ibc_core_client_v1_tx_pb.MsgIBCSoftwareUpgradeResponse|null) => void
  ): UnaryResponse;
  updateClientParams(
    requestMessage: ibc_core_client_v1_tx_pb.MsgUpdateParams,
    metadata: grpc.Metadata,
    callback: (error: ServiceError|null, responseMessage: ibc_core_client_v1_tx_pb.MsgUpdateParamsResponse|null) => void
  ): UnaryResponse;
  updateClientParams(
    requestMessage: ibc_core_client_v1_tx_pb.MsgUpdateParams,
    callback: (error: ServiceError|null, responseMessage: ibc_core_client_v1_tx_pb.MsgUpdateParamsResponse|null) => void
  ): UnaryResponse;
}

