import { Rpc } from "../../../helpers"; import * as _m0 from "protobufjs/minimal"; import { MsgSetWithdrawAddress, MsgSetWithdrawAddressResponse, MsgWithdrawDelegatorReward, MsgWithdrawDelegatorRewardResponse, MsgWithdrawValidatorCommission, MsgWithdrawValidatorCommissionResponse, MsgFundCommunityPool, MsgFundCommunityPoolResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgCommunityPoolSpend, MsgCommunityPoolSpendResponse, MsgDepositValidatorRewardsPool, MsgDepositValidatorRewardsPoolResponse } 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; /** * UpdateParams defines a governance operation for updating the x/distribution * module parameters. The authority is defined in the keeper. * * Since: cosmos-sdk 0.47 */ updateParams(request: MsgUpdateParams): Promise; /** * CommunityPoolSpend defines a governance operation for sending tokens from * the community pool in the x/distribution module to another account, which * could be the governance module itself. The authority is defined in the * keeper. * * Since: cosmos-sdk 0.47 */ communityPoolSpend(request: MsgCommunityPoolSpend): Promise; /** * DepositValidatorRewardsPool defines a method to provide additional rewards * to delegators to a specific validator. * * Since: cosmos-sdk 0.50 */ depositValidatorRewardsPool(request: MsgDepositValidatorRewardsPool): 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); this.updateParams = this.updateParams.bind(this); this.communityPoolSpend = this.communityPoolSpend.bind(this); this.depositValidatorRewardsPool = this.depositValidatorRewardsPool.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))); } updateParams(request: MsgUpdateParams): Promise { const data = MsgUpdateParams.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "UpdateParams", data); return promise.then(data => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); } communityPoolSpend(request: MsgCommunityPoolSpend): Promise { const data = MsgCommunityPoolSpend.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "CommunityPoolSpend", data); return promise.then(data => MsgCommunityPoolSpendResponse.decode(new _m0.Reader(data))); } depositValidatorRewardsPool(request: MsgDepositValidatorRewardsPool): Promise { const data = MsgDepositValidatorRewardsPool.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "DepositValidatorRewardsPool", data); return promise.then(data => MsgDepositValidatorRewardsPoolResponse.decode(new _m0.Reader(data))); } }