@firmachain/firma-js
Version:
The Official FirmaChain Javascript SDK written in Typescript
90 lines (89 loc) • 5.18 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.CommonTxClient = void 0;
var proto_signing_1 = require("@cosmjs/proto-signing");
var tx_1 = require("cosmjs-types/cosmos/bank/v1beta1/tx");
var tx_2 = require("cosmjs-types/cosmos/gov/v1/tx");
var tx_3 = require("cosmjs-types/cosmos/distribution/v1beta1/tx");
var tx_4 = require("cosmjs-types/cosmos/gov/v1beta1/tx");
var tx_5 = require("cosmjs-types/cosmos/staking/v1beta1/tx");
var tx_6 = require("cosmjs-types/cosmwasm/wasm/v1/tx");
// temporarly using kintsugi-tech/cosmjs-types - this will be returned to original cosmjs-types after the PR is merged
var tx_7 = require("@kintsugi-tech/cosmjs-types/cosmos/gov/v1/tx");
var AuthzTxTypes_1 = require("../authz/AuthzTxTypes");
var ContractTxTypes_1 = require("../contract/ContractTxTypes");
var FeeGrantTxTypes_1 = require("../feegrant/FeeGrantTxTypes");
var NftTxTypes_1 = require("../nft/NftTxTypes");
var TokenTxTypes_1 = require("../token/TokenTxTypes");
var ITxClient_1 = require("./ITxClient");
var types = [
["/cosmos.authz.v1beta1.MsgExec", AuthzTxTypes_1.MsgExec],
["/cosmos.authz.v1beta1.MsgGrant", AuthzTxTypes_1.MsgGrant],
["/cosmos.authz.v1beta1.MsgRevoke", AuthzTxTypes_1.MsgRevoke],
["/cosmos.bank.v1beta1.MsgSend", tx_1.MsgSend],
["/cosmos.bank.v1beta1.MsgMultiSend", tx_1.MsgMultiSend],
["/firmachain.contract.MsgCreateContractFile", ContractTxTypes_1.MsgCreateContractFile],
["/firmachain.contract.MsgAddContractLog", ContractTxTypes_1.MsgAddContractLog],
["/cosmwasm.wasm.v1.MsgStoreCode", tx_6.MsgStoreCode],
["/cosmwasm.wasm.v1.MsgInstantiateContract", tx_6.MsgInstantiateContract],
["/cosmwasm.wasm.v1.MsgExecuteContract", tx_6.MsgExecuteContract],
["/cosmwasm.wasm.v1.MsgUpdateAdmin", tx_6.MsgUpdateAdmin],
["/cosmwasm.wasm.v1.MsgClearAdmin", tx_6.MsgClearAdmin],
["/cosmwasm.wasm.v1.MsgMigrateContract", tx_6.MsgMigrateContract],
["/cosmos.distribution.v1beta1.MsgFundCommunityPool", tx_3.MsgFundCommunityPool],
["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", tx_3.MsgSetWithdrawAddress],
["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", tx_3.MsgWithdrawDelegatorReward],
["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", tx_3.MsgWithdrawValidatorCommission],
["/cosmos.feegrant.v1beta1.MsgGrantAllowance", FeeGrantTxTypes_1.MsgGrantAllowance],
["/cosmos.feegrant.v1beta1.MsgRevokeAllowance", FeeGrantTxTypes_1.MsgRevokeAllowance],
["/cosmos.gov.v1.MsgDeposit", tx_2.MsgDeposit],
["/cosmos.gov.v1.MsgSubmitProposal", tx_2.MsgSubmitProposal],
["/cosmos.gov.v1.MsgUpdateParams", tx_2.MsgUpdateParams],
["/cosmos.gov.v1.MsgVote", tx_2.MsgVote],
["/cosmos.gov.v1.MsgVoteWeighted", tx_2.MsgVoteWeighted],
["/cosmos.gov.v1.MsgCancelProposal", tx_7.MsgCancelProposal],
["/cosmos.gov.v1beta1.MsgDeposit", tx_4.MsgDeposit],
["/cosmos.gov.v1beta1.MsgSubmitProposal", tx_4.MsgSubmitProposal],
["/cosmos.gov.v1beta1.MsgVote", tx_4.MsgVote],
["/cosmos.gov.v1beta1.MsgVoteWeighted", tx_4.MsgVoteWeighted],
["/ibc.applications.transfer.v1.MsgTransfer", NftTxTypes_1.MsgTransfer],
["/firmachain.nft.MsgTransfer", NftTxTypes_1.MsgTransfer],
["/firmachain.nft.MsgMint", NftTxTypes_1.MsgMint],
["/firmachain.nft.MsgBurn", NftTxTypes_1.MsgBurn],
["/cosmos.staking.v1beta1.MsgDelegate", tx_5.MsgDelegate],
["/cosmos.staking.v1beta1.MsgUndelegate", tx_5.MsgUndelegate],
["/cosmos.staking.v1beta1.MsgBeginRedelegate", tx_5.MsgBeginRedelegate],
["/cosmos.staking.v1beta1.MsgEditValidator", tx_5.MsgEditValidator],
["/cosmos.staking.v1beta1.MsgCreateValidator", tx_5.MsgCreateValidator],
["/firmachain.token.MsgCreateToken", TokenTxTypes_1.MsgCreateToken],
["/firmachain.token.MsgUpdateTokenURI", TokenTxTypes_1.MsgUpdateTokenURI],
["/firmachain.token.MsgMint", NftTxTypes_1.MsgMint],
["/firmachain.token.MsgBurn", NftTxTypes_1.MsgBurn]
];
var registry = new proto_signing_1.Registry(types);
var CommonTxClient = /** @class */ (function (_super) {
__extends(CommonTxClient, _super);
function CommonTxClient(wallet, address) {
return _super.call(this, wallet, address, registry) || this;
}
CommonTxClient.getRegistry = function () {
return registry;
};
return CommonTxClient;
}(ITxClient_1.ITxClient));
exports.CommonTxClient = CommonTxClient;