import { BinaryReader } from '@agoric/cosmic-proto/codegen/binary.js';
import { MsgSendPacket, MsgSendPacketResponse, MsgRecvPacket, MsgRecvPacketResponse, MsgTimeout, MsgTimeoutResponse, MsgAcknowledgement, MsgAcknowledgementResponse, } from '@agoric/cosmic-proto/codegen/ibc/core/channel/v2/tx.js';
export class MsgClientImpl {
    rpc;
    constructor(rpc) {
        this.rpc = rpc;
        this.sendPacket = this.sendPacket.bind(this);
        this.recvPacket = this.recvPacket.bind(this);
        this.timeout = this.timeout.bind(this);
        this.acknowledgement = this.acknowledgement.bind(this);
    }
    sendPacket(request) {
        const data = MsgSendPacket.encode(request).finish();
        const promise = this.rpc.request('ibc.core.channel.v2.Msg', 'SendPacket', data);
        return promise.then(data => MsgSendPacketResponse.decode(new BinaryReader(data)));
    }
    recvPacket(request) {
        const data = MsgRecvPacket.encode(request).finish();
        const promise = this.rpc.request('ibc.core.channel.v2.Msg', 'RecvPacket', data);
        return promise.then(data => MsgRecvPacketResponse.decode(new BinaryReader(data)));
    }
    timeout(request) {
        const data = MsgTimeout.encode(request).finish();
        const promise = this.rpc.request('ibc.core.channel.v2.Msg', 'Timeout', data);
        return promise.then(data => MsgTimeoutResponse.decode(new BinaryReader(data)));
    }
    acknowledgement(request) {
        const data = MsgAcknowledgement.encode(request).finish();
        const promise = this.rpc.request('ibc.core.channel.v2.Msg', 'Acknowledgement', data);
        return promise.then(data => MsgAcknowledgementResponse.decode(new BinaryReader(data)));
    }
}
export const createClientImpl = (rpc) => {
    return new MsgClientImpl(rpc);
};
//# sourceMappingURL=tx.rpc.msg.js.map