@bandprotocol/bandchain.js
Version:
TypeScript library for Cosmos SDK and BandChain
73 lines (72 loc) • 4.11 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MsgClientImpl = void 0;
const binary_1 = require("../../../binary");
const tx_1 = require("./tx");
class MsgClientImpl {
rpc;
constructor(rpc) {
this.rpc = rpc;
this.createTunnel = this.createTunnel.bind(this);
this.updateRoute = this.updateRoute.bind(this);
this.updateSignalsAndInterval = this.updateSignalsAndInterval.bind(this);
this.withdrawFeePayerFunds = this.withdrawFeePayerFunds.bind(this);
this.activateTunnel = this.activateTunnel.bind(this);
this.deactivateTunnel = this.deactivateTunnel.bind(this);
this.triggerTunnel = this.triggerTunnel.bind(this);
this.depositToTunnel = this.depositToTunnel.bind(this);
this.withdrawFromTunnel = this.withdrawFromTunnel.bind(this);
this.updateParams = this.updateParams.bind(this);
}
createTunnel(request) {
const data = tx_1.MsgCreateTunnel.encode(request).finish();
const promise = this.rpc.request("band.tunnel.v1beta1.Msg", "CreateTunnel", data);
return promise.then(data => tx_1.MsgCreateTunnelResponse.decode(new binary_1.BinaryReader(data)));
}
updateRoute(request) {
const data = tx_1.MsgUpdateRoute.encode(request).finish();
const promise = this.rpc.request("band.tunnel.v1beta1.Msg", "UpdateRoute", data);
return promise.then(data => tx_1.MsgUpdateRouteResponse.decode(new binary_1.BinaryReader(data)));
}
updateSignalsAndInterval(request) {
const data = tx_1.MsgUpdateSignalsAndInterval.encode(request).finish();
const promise = this.rpc.request("band.tunnel.v1beta1.Msg", "UpdateSignalsAndInterval", data);
return promise.then(data => tx_1.MsgUpdateSignalsAndIntervalResponse.decode(new binary_1.BinaryReader(data)));
}
withdrawFeePayerFunds(request) {
const data = tx_1.MsgWithdrawFeePayerFunds.encode(request).finish();
const promise = this.rpc.request("band.tunnel.v1beta1.Msg", "WithdrawFeePayerFunds", data);
return promise.then(data => tx_1.MsgWithdrawFeePayerFundsResponse.decode(new binary_1.BinaryReader(data)));
}
activateTunnel(request) {
const data = tx_1.MsgActivateTunnel.encode(request).finish();
const promise = this.rpc.request("band.tunnel.v1beta1.Msg", "ActivateTunnel", data);
return promise.then(data => tx_1.MsgActivateTunnelResponse.decode(new binary_1.BinaryReader(data)));
}
deactivateTunnel(request) {
const data = tx_1.MsgDeactivateTunnel.encode(request).finish();
const promise = this.rpc.request("band.tunnel.v1beta1.Msg", "DeactivateTunnel", data);
return promise.then(data => tx_1.MsgDeactivateTunnelResponse.decode(new binary_1.BinaryReader(data)));
}
triggerTunnel(request) {
const data = tx_1.MsgTriggerTunnel.encode(request).finish();
const promise = this.rpc.request("band.tunnel.v1beta1.Msg", "TriggerTunnel", data);
return promise.then(data => tx_1.MsgTriggerTunnelResponse.decode(new binary_1.BinaryReader(data)));
}
depositToTunnel(request) {
const data = tx_1.MsgDepositToTunnel.encode(request).finish();
const promise = this.rpc.request("band.tunnel.v1beta1.Msg", "DepositToTunnel", data);
return promise.then(data => tx_1.MsgDepositToTunnelResponse.decode(new binary_1.BinaryReader(data)));
}
withdrawFromTunnel(request) {
const data = tx_1.MsgWithdrawFromTunnel.encode(request).finish();
const promise = this.rpc.request("band.tunnel.v1beta1.Msg", "WithdrawFromTunnel", data);
return promise.then(data => tx_1.MsgWithdrawFromTunnelResponse.decode(new binary_1.BinaryReader(data)));
}
updateParams(request) {
const data = tx_1.MsgUpdateParams.encode(request).finish();
const promise = this.rpc.request("band.tunnel.v1beta1.Msg", "UpdateParams", data);
return promise.then(data => tx_1.MsgUpdateParamsResponse.decode(new binary_1.BinaryReader(data)));
}
}
exports.MsgClientImpl = MsgClientImpl;