"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Chainable_1 = require("../Chainable");
class ToWiseOperationTransformer extends Chainable_1.ChainableTransformer {
    constructor(protocol) {
        super();
        this.protocol = protocol;
    }
    me() {
        return this;
    }
    take(error, steemTrx) {
        if (error)
            throw error;
        const handledOrRejected = this.protocol.handleOrReject(steemTrx);
        if (handledOrRejected) {
            let lastResult = true;
            for (let i = 0; i < handledOrRejected.length; i++) {
                lastResult = this.give(undefined, handledOrRejected[i]);
            }
            return lastResult;
        }
        else
            return true;
    }
}
exports.ToWiseOperationTransformer = ToWiseOperationTransformer;
//# sourceMappingURL=ToWiseOperationTransformer.js.map