@taquito/taquito
Version:
High level functionality that builds upon the other packages in the Tezos Typescript Library Suite.
34 lines • 1.07 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BallotOperation = void 0;
const operations_1 = require("./operations");
/**
*
* @description BallotOperation provides utility functions to fetch a new operation of kind ballot
*
*/
class BallotOperation extends operations_1.Operation {
constructor(hash, params, source, raw, results, context) {
super(hash, raw, results, context);
this.params = params;
this.source = source;
}
get operationResults() {
const ballotOp = Array.isArray(this.results) &&
this.results.find((op) => op.kind === 'ballot');
const result = ballotOp;
return result ? result : undefined;
}
get period() {
var _a;
return (_a = this.operationResults) === null || _a === void 0 ? void 0 : _a.period;
}
get proposal() {
return this.params.proposal;
}
get ballot() {
return this.params.ballot;
}
}
exports.BallotOperation = BallotOperation;
//# sourceMappingURL=ballot-operation.js.map