UNPKG

@bandprotocol/bandchain.js

Version:

TypeScript library for Cosmos SDK and BandChain

25 lines (24 loc) 1.05 kB
"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.softwareUpgrade = this.softwareUpgrade.bind(this); this.cancelUpgrade = this.cancelUpgrade.bind(this); } softwareUpgrade(request) { const data = tx_1.MsgSoftwareUpgrade.encode(request).finish(); const promise = this.rpc.request("cosmos.upgrade.v1beta1.Msg", "SoftwareUpgrade", data); return promise.then(data => tx_1.MsgSoftwareUpgradeResponse.decode(new binary_1.BinaryReader(data))); } cancelUpgrade(request) { const data = tx_1.MsgCancelUpgrade.encode(request).finish(); const promise = this.rpc.request("cosmos.upgrade.v1beta1.Msg", "CancelUpgrade", data); return promise.then(data => tx_1.MsgCancelUpgradeResponse.decode(new binary_1.BinaryReader(data))); } } exports.MsgClientImpl = MsgClientImpl;