import { Rpc } from "../../../helpers"; import * as _m0 from "protobufjs/minimal"; import { MsgSetWithdrawAddress, MsgSetWithdrawAddressResponse, MsgWithdrawDelegatorReward, MsgWithdrawDelegatorRewardResponse, MsgWithdrawValidatorCommission, MsgWithdrawValidatorCommissionResponse, MsgFundCommunityPool, MsgFundCommunityPoolResponse } from "./tx"; /** Msg defines the distribution Msg service. */ export interface Msg { /** * SetWithdrawAddress defines a method to change the withdraw address * for a delegator (or validator self-delegation). */ setWithdrawAddress(request: MsgSetWithdrawAddress): Promise; /** * WithdrawDelegatorReward defines a method to withdraw rewards of delegator * from a single validator. */ withdrawDelegatorReward(request: MsgWithdrawDelegatorReward): Promise; /** * WithdrawValidatorCommission defines a method to withdraw the * full commission to the validator address. */ withdrawValidatorCommission(request: MsgWithdrawValidatorCommission): Promise; /** * FundCommunityPool defines a method to allow an account to directly * fund the community pool. */ fundCommunityPool(request: MsgFundCommunityPool): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; this.setWithdrawAddress = this.setWithdrawAddress.bind(this); this.withdrawDelegatorReward = this.withdrawDelegatorReward.bind(this); this.withdrawValidatorCommission = this.withdrawValidatorCommission.bind(this); this.fundCommunityPool = this.fundCommunityPool.bind(this); } setWithdrawAddress(request: MsgSetWithdrawAddress): Promise { const data = MsgSetWithdrawAddress.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "SetWithdrawAddress", data); return promise.then(data => MsgSetWithdrawAddressResponse.decode(new _m0.Reader(data))); } withdrawDelegatorReward(request: MsgWithdrawDelegatorReward): Promise { const data = MsgWithdrawDelegatorReward.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "WithdrawDelegatorReward", data); return promise.then(data => MsgWithdrawDelegatorRewardResponse.decode(new _m0.Reader(data))); } withdrawValidatorCommission(request: MsgWithdrawValidatorCommission): Promise { const data = MsgWithdrawValidatorCommission.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "WithdrawValidatorCommission", data); return promise.then(data => MsgWithdrawValidatorCommissionResponse.decode(new _m0.Reader(data))); } fundCommunityPool(request: MsgFundCommunityPool): Promise { const data = MsgFundCommunityPool.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "FundCommunityPool", data); return promise.then(data => MsgFundCommunityPoolResponse.decode(new _m0.Reader(data))); } }