import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
//@ts-nocheck

import * as _m0 from "protobufjs/minimal";
import { MsgCreateBond, MsgCreateBondResponse, MsgEditBond, MsgEditBondResponse, MsgSetNextAlpha, MsgSetNextAlphaResponse, MsgUpdateBondState, MsgUpdateBondStateResponse, MsgBuy, MsgBuyResponse, MsgSell, MsgSellResponse, MsgSwap, MsgSwapResponse, MsgMakeOutcomePayment, MsgMakeOutcomePaymentResponse, MsgWithdrawShare, MsgWithdrawShareResponse, MsgWithdrawReserve, MsgWithdrawReserveResponse } from "./tx";
/** Msg defines the bonds Msg service. */

export class MsgClientImpl {
  constructor(rpc) {
    _defineProperty(this, "rpc", void 0);
    this.rpc = rpc;
    this.createBond = this.createBond.bind(this);
    this.editBond = this.editBond.bind(this);
    this.setNextAlpha = this.setNextAlpha.bind(this);
    this.updateBondState = this.updateBondState.bind(this);
    this.buy = this.buy.bind(this);
    this.sell = this.sell.bind(this);
    this.swap = this.swap.bind(this);
    this.makeOutcomePayment = this.makeOutcomePayment.bind(this);
    this.withdrawShare = this.withdrawShare.bind(this);
    this.withdrawReserve = this.withdrawReserve.bind(this);
  }
  createBond(request) {
    const data = MsgCreateBond.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Msg", "CreateBond", data);
    return promise.then(data => MsgCreateBondResponse.decode(new _m0.Reader(data)));
  }
  editBond(request) {
    const data = MsgEditBond.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Msg", "EditBond", data);
    return promise.then(data => MsgEditBondResponse.decode(new _m0.Reader(data)));
  }
  setNextAlpha(request) {
    const data = MsgSetNextAlpha.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Msg", "SetNextAlpha", data);
    return promise.then(data => MsgSetNextAlphaResponse.decode(new _m0.Reader(data)));
  }
  updateBondState(request) {
    const data = MsgUpdateBondState.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Msg", "UpdateBondState", data);
    return promise.then(data => MsgUpdateBondStateResponse.decode(new _m0.Reader(data)));
  }
  buy(request) {
    const data = MsgBuy.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Msg", "Buy", data);
    return promise.then(data => MsgBuyResponse.decode(new _m0.Reader(data)));
  }
  sell(request) {
    const data = MsgSell.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Msg", "Sell", data);
    return promise.then(data => MsgSellResponse.decode(new _m0.Reader(data)));
  }
  swap(request) {
    const data = MsgSwap.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Msg", "Swap", data);
    return promise.then(data => MsgSwapResponse.decode(new _m0.Reader(data)));
  }
  makeOutcomePayment(request) {
    const data = MsgMakeOutcomePayment.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Msg", "MakeOutcomePayment", data);
    return promise.then(data => MsgMakeOutcomePaymentResponse.decode(new _m0.Reader(data)));
  }
  withdrawShare(request) {
    const data = MsgWithdrawShare.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Msg", "WithdrawShare", data);
    return promise.then(data => MsgWithdrawShareResponse.decode(new _m0.Reader(data)));
  }
  withdrawReserve(request) {
    const data = MsgWithdrawReserve.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Msg", "WithdrawReserve", data);
    return promise.then(data => MsgWithdrawReserveResponse.decode(new _m0.Reader(data)));
  }
}