import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import * as _m0 from "protobufjs/minimal";
import { MsgCreateInsuranceFund, MsgCreateInsuranceFundResponse, MsgUnderwrite, MsgUnderwriteResponse, MsgRequestRedemption, MsgRequestRedemptionResponse } from "./tx";
/** Msg defines the insurance Msg service. */

export class MsgClientImpl {
  constructor(rpc) {
    _defineProperty(this, "rpc", void 0);
    this.rpc = rpc;
    this.createInsuranceFund = this.createInsuranceFund.bind(this);
    this.underwrite = this.underwrite.bind(this);
    this.requestRedemption = this.requestRedemption.bind(this);
  }
  createInsuranceFund(request) {
    const data = MsgCreateInsuranceFund.encode(request).finish();
    const promise = this.rpc.request("injective.insurance.v1beta1.Msg", "CreateInsuranceFund", data);
    return promise.then(data => MsgCreateInsuranceFundResponse.decode(new _m0.Reader(data)));
  }
  underwrite(request) {
    const data = MsgUnderwrite.encode(request).finish();
    const promise = this.rpc.request("injective.insurance.v1beta1.Msg", "Underwrite", data);
    return promise.then(data => MsgUnderwriteResponse.decode(new _m0.Reader(data)));
  }
  requestRedemption(request) {
    const data = MsgRequestRedemption.encode(request).finish();
    const promise = this.rpc.request("injective.insurance.v1beta1.Msg", "RequestRedemption", data);
    return promise.then(data => MsgRequestRedemptionResponse.decode(new _m0.Reader(data)));
  }
}