UNPKG

@bandprotocol/bandchain.js

Version:

TypeScript library for Cosmos SDK and BandChain

61 lines (60 loc) 3.1 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.submitDKGRound1 = this.submitDKGRound1.bind(this); this.submitDKGRound2 = this.submitDKGRound2.bind(this); this.complain = this.complain.bind(this); this.confirm = this.confirm.bind(this); this.submitDEs = this.submitDEs.bind(this); this.resetDE = this.resetDE.bind(this); this.submitSignature = this.submitSignature.bind(this); this.updateParams = this.updateParams.bind(this); } submitDKGRound1(request) { const data = tx_1.MsgSubmitDKGRound1.encode(request).finish(); const promise = this.rpc.request("band.tss.v1beta1.Msg", "SubmitDKGRound1", data); return promise.then(data => tx_1.MsgSubmitDKGRound1Response.decode(new binary_1.BinaryReader(data))); } submitDKGRound2(request) { const data = tx_1.MsgSubmitDKGRound2.encode(request).finish(); const promise = this.rpc.request("band.tss.v1beta1.Msg", "SubmitDKGRound2", data); return promise.then(data => tx_1.MsgSubmitDKGRound2Response.decode(new binary_1.BinaryReader(data))); } complain(request) { const data = tx_1.MsgComplain.encode(request).finish(); const promise = this.rpc.request("band.tss.v1beta1.Msg", "Complain", data); return promise.then(data => tx_1.MsgComplainResponse.decode(new binary_1.BinaryReader(data))); } confirm(request) { const data = tx_1.MsgConfirm.encode(request).finish(); const promise = this.rpc.request("band.tss.v1beta1.Msg", "Confirm", data); return promise.then(data => tx_1.MsgConfirmResponse.decode(new binary_1.BinaryReader(data))); } submitDEs(request) { const data = tx_1.MsgSubmitDEs.encode(request).finish(); const promise = this.rpc.request("band.tss.v1beta1.Msg", "SubmitDEs", data); return promise.then(data => tx_1.MsgSubmitDEsResponse.decode(new binary_1.BinaryReader(data))); } resetDE(request) { const data = tx_1.MsgResetDE.encode(request).finish(); const promise = this.rpc.request("band.tss.v1beta1.Msg", "ResetDE", data); return promise.then(data => tx_1.MsgResetDEResponse.decode(new binary_1.BinaryReader(data))); } submitSignature(request) { const data = tx_1.MsgSubmitSignature.encode(request).finish(); const promise = this.rpc.request("band.tss.v1beta1.Msg", "SubmitSignature", data); return promise.then(data => tx_1.MsgSubmitSignatureResponse.decode(new binary_1.BinaryReader(data))); } updateParams(request) { const data = tx_1.MsgUpdateParams.encode(request).finish(); const promise = this.rpc.request("band.tss.v1beta1.Msg", "UpdateParams", data); return promise.then(data => tx_1.MsgUpdateParamsResponse.decode(new binary_1.BinaryReader(data))); } } exports.MsgClientImpl = MsgClientImpl;