"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.OrchestrationMixin = void 0;
const _1 = require(".");
const base_core_sdk_1 = require("./../mixins/base-core-sdk");
class OrchestrationMixin extends base_core_sdk_1.BaseCoreSDK {
    // Implementation
    createOfferWithCondition(offerToCreate_1, condition_1) {
        return __awaiter(this, arguments, void 0, function* (offerToCreate, condition, overrides = {}) {
            const { returnTxInfo } = overrides;
            const createArgs = {
                offerToCreate,
                condition,
                web3Lib: this._web3Lib,
                metadataStorage: this._metadataStorage,
                theGraphStorage: this._theGraphStorage,
                contractAddress: overrides.contractAddress || this._protocolDiamond
            };
            if (returnTxInfo === true) {
                return _1.handler.createOfferWithCondition(Object.assign(Object.assign({}, createArgs), { returnTxInfo: true }));
            }
            else {
                return _1.handler.createOfferWithCondition(Object.assign(Object.assign({}, createArgs), { returnTxInfo: false }));
            }
        });
    }
    // Implementation
    createSellerAndOfferWithCondition(sellerToCreate_1, offerToCreate_1, condition_1) {
        return __awaiter(this, arguments, void 0, function* (sellerToCreate, offerToCreate, condition, overrides = {}) {
            const { returnTxInfo } = overrides;
            const createArgs = {
                sellerToCreate,
                offerToCreate,
                condition,
                web3Lib: this._web3Lib,
                metadataStorage: this._metadataStorage,
                theGraphStorage: this._theGraphStorage,
                contractAddress: overrides.contractAddress || this._protocolDiamond
            };
            if (returnTxInfo === true) {
                return _1.handler.createSellerAndOfferWithCondition(Object.assign(Object.assign({}, createArgs), { returnTxInfo: true }));
            }
            else {
                return _1.handler.createSellerAndOfferWithCondition(Object.assign(Object.assign({}, createArgs), { returnTxInfo: false }));
            }
        });
    }
    // Implementation
    createPremintedOfferAddToGroup(offerToCreate_1, premintParameters_1, groupId_1) {
        return __awaiter(this, arguments, void 0, function* (offerToCreate, premintParameters, groupId, overrides = {}) {
            const { returnTxInfo } = overrides;
            const createArgs = {
                offerToCreate,
                premintParameters,
                groupId,
                web3Lib: this._web3Lib,
                metadataStorage: this._metadataStorage,
                theGraphStorage: this._theGraphStorage,
                contractAddress: overrides.contractAddress || this._protocolDiamond
            };
            if (returnTxInfo === true) {
                return _1.handler.createPremintedOfferAddToGroup(Object.assign(Object.assign({}, createArgs), { returnTxInfo: true }));
            }
            else {
                return _1.handler.createPremintedOfferAddToGroup(Object.assign(Object.assign({}, createArgs), { returnTxInfo: false }));
            }
        });
    }
    // Implementation
    createSellerAndPremintedOffer(sellerToCreate_1, offerToCreate_1, premintParameters_1) {
        return __awaiter(this, arguments, void 0, function* (sellerToCreate, offerToCreate, premintParameters, overrides = {}) {
            const { returnTxInfo } = overrides;
            const createArgs = {
                sellerToCreate,
                offerToCreate,
                premintParameters,
                web3Lib: this._web3Lib,
                metadataStorage: this._metadataStorage,
                theGraphStorage: this._theGraphStorage,
                contractAddress: overrides.contractAddress || this._protocolDiamond
            };
            if (returnTxInfo === true) {
                return _1.handler.createSellerAndPremintedOffer(Object.assign(Object.assign({}, createArgs), { returnTxInfo: true }));
            }
            else {
                return _1.handler.createSellerAndPremintedOffer(Object.assign(Object.assign({}, createArgs), { returnTxInfo: false }));
            }
        });
    }
    // Implementation
    createPremintedOfferWithCondition(offerToCreate_1, premintParameters_1, condition_1) {
        return __awaiter(this, arguments, void 0, function* (offerToCreate, premintParameters, condition, overrides = {}) {
            const { returnTxInfo } = overrides;
            const createArgs = {
                offerToCreate,
                premintParameters,
                condition,
                web3Lib: this._web3Lib,
                metadataStorage: this._metadataStorage,
                theGraphStorage: this._theGraphStorage,
                contractAddress: overrides.contractAddress || this._protocolDiamond
            };
            if (returnTxInfo === true) {
                return _1.handler.createPremintedOfferWithCondition(Object.assign(Object.assign({}, createArgs), { returnTxInfo: true }));
            }
            else {
                return _1.handler.createPremintedOfferWithCondition(Object.assign(Object.assign({}, createArgs), { returnTxInfo: false }));
            }
        });
    }
    // Implementation
    createSellerAndPremintedOfferWithCondition(sellerToCreate_1, offerToCreate_1, premintParameters_1, condition_1) {
        return __awaiter(this, arguments, void 0, function* (sellerToCreate, offerToCreate, premintParameters, condition, overrides = {}) {
            const { returnTxInfo } = overrides;
            const createArgs = {
                sellerToCreate,
                offerToCreate,
                premintParameters,
                condition,
                web3Lib: this._web3Lib,
                metadataStorage: this._metadataStorage,
                theGraphStorage: this._theGraphStorage,
                contractAddress: overrides.contractAddress || this._protocolDiamond
            };
            if (returnTxInfo === true) {
                return _1.handler.createSellerAndPremintedOfferWithCondition(Object.assign(Object.assign({}, createArgs), { returnTxInfo: true }));
            }
            else {
                return _1.handler.createSellerAndPremintedOfferWithCondition(Object.assign(Object.assign({}, createArgs), { returnTxInfo: false }));
            }
        });
    }
    // Implementation
    commitToOfferAndRedeemVoucher(offerId_1) {
        return __awaiter(this, arguments, void 0, function* (offerId, overrides = {}) {
            const { returnTxInfo } = overrides;
            const commitArgs = {
                offerId,
                web3Lib: this._web3Lib,
                subgraphUrl: this._subgraphUrl,
                metadataStorage: this._metadataStorage,
                theGraphStorage: this._theGraphStorage,
                contractAddress: overrides.contractAddress || this._protocolDiamond
            };
            if (returnTxInfo === true) {
                return _1.handler.commitToOfferAndRedeemVoucher(Object.assign(Object.assign({}, commitArgs), { returnTxInfo: true }));
            }
            else {
                return _1.handler.commitToOfferAndRedeemVoucher(Object.assign(Object.assign({}, commitArgs), { returnTxInfo: false }));
            }
        });
    }
    // Implementation
    commitToConditionalOfferAndRedeemVoucher(offerId_1, tokenId_1) {
        return __awaiter(this, arguments, void 0, function* (offerId, tokenId, overrides = {}) {
            const { returnTxInfo } = overrides;
            const commitArgs = {
                offerId,
                tokenId,
                web3Lib: this._web3Lib,
                subgraphUrl: this._subgraphUrl,
                metadataStorage: this._metadataStorage,
                theGraphStorage: this._theGraphStorage,
                contractAddress: overrides.contractAddress || this._protocolDiamond
            };
            if (returnTxInfo === true) {
                return _1.handler.commitToConditionalOfferAndRedeemVoucher(Object.assign(Object.assign({}, commitArgs), { returnTxInfo: true }));
            }
            else {
                return _1.handler.commitToConditionalOfferAndRedeemVoucher(Object.assign(Object.assign({}, commitArgs), { returnTxInfo: false }));
            }
        });
    }
    // Implementation
    createOfferCommitAndRedeem(createOfferAndCommitArgs_1) {
        return __awaiter(this, arguments, void 0, function* (createOfferAndCommitArgs, overrides = {}) {
            const { returnTxInfo } = overrides;
            const offerArgs = {
                createOfferAndCommitArgs,
                web3Lib: this._web3Lib,
                subgraphUrl: this._subgraphUrl,
                metadataStorage: this._metadataStorage,
                theGraphStorage: this._theGraphStorage,
                contractAddress: overrides.contractAddress || this._protocolDiamond,
                txRequest: overrides.txRequest
            };
            if (returnTxInfo === true) {
                return _1.handler.createOfferCommitAndRedeem(Object.assign(Object.assign({}, offerArgs), { returnTxInfo: true }));
            }
            else {
                return _1.handler.createOfferCommitAndRedeem(Object.assign(Object.assign({}, offerArgs), { returnTxInfo: false }));
            }
        });
    }
    // Implementation
    raiseAndEscalateDispute(exchangeId_1) {
        return __awaiter(this, arguments, void 0, function* (exchangeId, overrides = {}) {
            const { returnTxInfo } = overrides;
            const disputeArgs = {
                exchangeId,
                web3Lib: this._web3Lib,
                metadataStorage: this._metadataStorage,
                theGraphStorage: this._theGraphStorage,
                contractAddress: overrides.contractAddress || this._protocolDiamond
            };
            if (returnTxInfo === true) {
                return _1.handler.raiseAndEscalateDispute(Object.assign(Object.assign({}, disputeArgs), { returnTxInfo: true }));
            }
            else {
                return _1.handler.raiseAndEscalateDispute(Object.assign(Object.assign({}, disputeArgs), { returnTxInfo: false }));
            }
        });
    }
}
exports.OrchestrationMixin = OrchestrationMixin;
//# sourceMappingURL=mixin.js.map