@pokt-network/pocket-js
Version:
Pocket-js core package with the main functionalities to interact with the Pocket Network.
43 lines • 1.9 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 (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
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.AminoTxEncoder = void 0;
var utils_1 = require("../../utils");
var rpc_1 = require("../../rpc");
var std_tx_1 = require("../models/std-tx");
var std_sign_doc_1 = require("../models/std-sign-doc");
var base_tx_encoder_1 = require("./base-tx-encoder");
var AminoTxEncoder = /** @class */ (function (_super) {
__extends(AminoTxEncoder, _super);
function AminoTxEncoder() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.doc = undefined;
return _this;
}
AminoTxEncoder.prototype.marshalStdSignDoc = function () {
this.doc = new std_sign_doc_1.StdSignDoc(this.entropy, this.chainID, this.msg, this.fee, this.feeDenom, this.memo);
return this.doc.marshalAmino();
};
AminoTxEncoder.prototype.marshalStdTx = function (signature) {
if (utils_1.typeGuard(this.doc, std_sign_doc_1.StdSignDoc)) {
var transaction = new std_tx_1.StdTx(this.doc, signature);
return transaction.marshalAmino();
}
throw new rpc_1.RpcError("500", "StdDoc not defined");
};
return AminoTxEncoder;
}(base_tx_encoder_1.BaseTxEncoder));
exports.AminoTxEncoder = AminoTxEncoder;
//# sourceMappingURL=amino-tx-encoder.js.map