import { Rpc } from "../../../../helpers"; import { BinaryReader } from "../../../../binary"; import { MsgTransfer, MsgTransferResponse } from "./tx"; /** Msg defines the ibc/transfer Msg service. */ export interface Msg { /** Transfer defines a rpc handler method for MsgTransfer. */ transfer(request: MsgTransfer): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; this.transfer = this.transfer.bind(this); } transfer(request: MsgTransfer): Promise { const data = MsgTransfer.encode(request).finish(); const promise = this.rpc.request("ibc.applications.transfer.v1.Msg", "Transfer", data); return promise.then(data => MsgTransferResponse.decode(new BinaryReader(data))); } }