UNPKG

stellar-plus

Version:

beta version of stellar-plus, an all-in-one sdk for the Stellar blockchain

24 lines (23 loc) 1.03 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ExtractWasmHashPlugin = void 0; const tslib_1 = require("tslib"); const types_1 = require("../../../../../../stellar-plus/core/pipelines/soroban-get-transaction/types"); class ExtractWasmHashPlugin { constructor() { this.type = types_1.SorobanGetTransactionPipelineType.id; this.name = 'ExtractWasmHashPlugin'; } postProcess(item, _meta) { return tslib_1.__awaiter(this, void 0, void 0, function* () { var _a; const { response, output } = item; const wasmHash = ((_a = response.resultMetaXdr.v3().sorobanMeta()) === null || _a === void 0 ? void 0 : _a.returnValue().value()).toString('hex'); const pluginOutput = { wasmHash, }; return Object.assign(Object.assign({}, item), { output: Object.assign(Object.assign({}, output), pluginOutput) }); }); } } exports.ExtractWasmHashPlugin = ExtractWasmHashPlugin;