import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import { BinaryReader } from "../binary";
import { MsgClaim, MsgClaimResponse, MsgCreateReward, MsgCreateRewardResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx";
/** Msg defines the Msg service. */

export class MsgClientImpl {
  constructor(rpc) {
    _defineProperty(this, "rpc", void 0);
    this.rpc = rpc;
    this.claim = this.claim.bind(this);
    this.createReward = this.createReward.bind(this);
    this.updateParams = this.updateParams.bind(this);
  }
  claim(request) {
    const data = MsgClaim.encode(request).finish();
    const promise = this.rpc.request("gitopia.gitopia.rewards.Msg", "Claim", data);
    return promise.then(data => MsgClaimResponse.decode(new BinaryReader(data)));
  }
  createReward(request) {
    const data = MsgCreateReward.encode(request).finish();
    const promise = this.rpc.request("gitopia.gitopia.rewards.Msg", "CreateReward", data);
    return promise.then(data => MsgCreateRewardResponse.decode(new BinaryReader(data)));
  }
  updateParams(request) {
    const data = MsgUpdateParams.encode(request).finish();
    const promise = this.rpc.request("gitopia.gitopia.rewards.Msg", "UpdateParams", data);
    return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data)));
  }
}