import { Rpc } from "../../../helpers"; import * as _m0 from "protobufjs/minimal"; import { MsgSend, MsgSendResponse, MsgMultiSend, MsgMultiSendResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgSetSendEnabled, MsgSetSendEnabledResponse } from "./tx"; /** Msg defines the bank Msg service. */ export interface Msg { /** Send defines a method for sending coins from one account to another account. */ send(request: MsgSend): Promise; /** MultiSend defines a method for sending coins from some accounts to other accounts. */ multiSend(request: MsgMultiSend): Promise; /** * UpdateParams defines a governance operation for updating the x/bank module parameters. * The authority is defined in the keeper. * * Since: cosmos-sdk 0.47 */ updateParams(request: MsgUpdateParams): Promise; /** * SetSendEnabled is a governance operation for setting the SendEnabled flag * on any number of Denoms. Only the entries to add or update should be * included. Entries that already exist in the store, but that aren't * included in this message, will be left unchanged. * * Since: cosmos-sdk 0.47 */ setSendEnabled(request: MsgSetSendEnabled): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; this.send = this.send.bind(this); this.multiSend = this.multiSend.bind(this); this.updateParams = this.updateParams.bind(this); this.setSendEnabled = this.setSendEnabled.bind(this); } send(request: MsgSend): Promise { const data = MsgSend.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "Send", data); return promise.then(data => MsgSendResponse.decode(new _m0.Reader(data))); } multiSend(request: MsgMultiSend): Promise { const data = MsgMultiSend.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "MultiSend", data); return promise.then(data => MsgMultiSendResponse.decode(new _m0.Reader(data))); } updateParams(request: MsgUpdateParams): Promise { const data = MsgUpdateParams.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "UpdateParams", data); return promise.then(data => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); } setSendEnabled(request: MsgSetSendEnabled): Promise { const data = MsgSetSendEnabled.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "SetSendEnabled", data); return promise.then(data => MsgSetSendEnabledResponse.decode(new _m0.Reader(data))); } }