UNPKG

@taquito/taquito

Version:

High level functionality that builds upon the other packages in the Tezos Typescript Library Suite.

57 lines 2.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SmartRollupOriginateOperation = void 0; const rpc_1 = require("@taquito/rpc"); const operations_1 = require("./operations"); /** * * @description SmartRollupOriginate Operation provides utility to fetch properties for Operation of kind SmartRollupOriginate * */ class SmartRollupOriginateOperation 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 smartRollupOriginateOp = Array.isArray(this.results) && this.results.find((op) => op.kind === rpc_1.OpKind.SMART_ROLLUP_ORIGINATE); const result = smartRollupOriginateOp && smartRollupOriginateOp.metadata && smartRollupOriginateOp.metadata.operation_result; return result ? result : undefined; } get status() { var _a, _b; return (_b = (_a = this.operationResults) === null || _a === void 0 ? void 0 : _a.status) !== null && _b !== void 0 ? _b : 'unknown'; } get fee() { return Number(this.params.fee); } get gasLimit() { return Number(this.params.gas_limit); } get storageLimit() { return Number(this.params.storage_limit); } get consumedMilliGas() { var _a; return (_a = this.operationResults) === null || _a === void 0 ? void 0 : _a.consumed_milligas; } get pvmKind() { return this.params.pvm_kind; } get kernel() { return this.params.kernel; } get originationProof() { return this.params.origination_proof; } get errors() { var _a; return (_a = this.operationResults) === null || _a === void 0 ? void 0 : _a.errors; } } exports.SmartRollupOriginateOperation = SmartRollupOriginateOperation; //# sourceMappingURL=smart-rollup-originate-operation.js.map