@firmachain/firma-js
Version:
The Official FirmaChain Javascript SDK written in Typescript
79 lines (78 loc) • 3.68 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.GovTxClient = void 0;
var proto_signing_1 = require("@cosmjs/proto-signing");
var tx_1 = require("@kintsugi-tech/cosmjs-types/cosmos/gov/v1/tx");
var tx_2 = require("@kintsugi-tech/cosmjs-types/cosmos/gov/v1beta1/tx");
// temporarly using kintsugi-tech/cosmjs-types - this will be returned to original cosmjs-types after the PR is merged
var tx_3 = require("@kintsugi-tech/cosmjs-types/cosmos/gov/v1/tx");
var ITxClient_1 = require("../common/ITxClient");
var types = [
["/cosmos.gov.v1.MsgDeposit", tx_1.MsgDeposit],
["/cosmos.gov.v1.MsgSubmitProposal", tx_1.MsgSubmitProposal],
["/cosmos.gov.v1.MsgUpdateParams", tx_1.MsgUpdateParams],
["/cosmos.gov.v1.MsgVote", tx_1.MsgVote],
["/cosmos.gov.v1.MsgVoteWeighted", tx_1.MsgVoteWeighted],
["/cosmos.gov.v1.MsgCancelProposal", tx_3.MsgCancelProposal],
["/cosmos.gov.v1beta1.MsgDeposit", tx_2.MsgDeposit],
["/cosmos.gov.v1beta1.MsgSubmitProposal", tx_2.MsgSubmitProposal],
["/cosmos.gov.v1beta1.MsgVote", tx_2.MsgVote],
["/cosmos.gov.v1beta1.MsgVoteWeighted", tx_2.MsgVoteWeighted],
];
var registry = new proto_signing_1.Registry(types);
var GovTxClient = /** @class */ (function (_super) {
__extends(GovTxClient, _super);
function GovTxClient(wallet, serverUrl) {
return _super.call(this, wallet, serverUrl, registry) || this;
}
GovTxClient.getRegistry = function () {
return registry;
};
GovTxClient.v1MsgDeposit = function (data) {
return { typeUrl: "/cosmos.gov.v1.MsgDeposit", value: data };
};
GovTxClient.v1MsgSubmitProposal = function (data) {
return { typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", value: data };
};
GovTxClient.v1MsgUpdateParams = function (data) {
return { typeUrl: "/cosmos.gov.v1.MsgUpdateParams", value: data };
};
GovTxClient.v1MsgVote = function (data) {
return { typeUrl: "/cosmos.gov.v1.MsgVote", value: data };
};
GovTxClient.v1MsgVoteWeighted = function (data) {
return { typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", value: data };
};
GovTxClient.v1MsgCancelProposal = function (data) {
return { typeUrl: "/cosmos.gov.v1.MsgCancelProposal", value: data };
};
GovTxClient.msgDeposit = function (data) {
return { typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", value: data };
};
GovTxClient.msgSubmitProposal = function (data) {
return { typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", value: data };
};
GovTxClient.msgVote = function (data) {
return { typeUrl: "/cosmos.gov.v1beta1.MsgVote", value: data };
};
GovTxClient.msgVoteWeighted = function (data) {
return { typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", value: data };
};
return GovTxClient;
}(ITxClient_1.ITxClient));
exports.GovTxClient = GovTxClient;