import { handler } from ".";
import { BaseCoreSDK } from "./../mixins/base-core-sdk";
export class OrchestrationMixin extends BaseCoreSDK {
    // Implementation
    async createOfferWithCondition(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 handler.createOfferWithCondition({
                ...createArgs,
                returnTxInfo: true
            });
        }
        else {
            return handler.createOfferWithCondition({
                ...createArgs,
                returnTxInfo: false
            });
        }
    }
    // Implementation
    async createSellerAndOfferWithCondition(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 handler.createSellerAndOfferWithCondition({
                ...createArgs,
                returnTxInfo: true
            });
        }
        else {
            return handler.createSellerAndOfferWithCondition({
                ...createArgs,
                returnTxInfo: false
            });
        }
    }
    // Implementation
    async createPremintedOfferAddToGroup(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 handler.createPremintedOfferAddToGroup({
                ...createArgs,
                returnTxInfo: true
            });
        }
        else {
            return handler.createPremintedOfferAddToGroup({
                ...createArgs,
                returnTxInfo: false
            });
        }
    }
    // Implementation
    async createSellerAndPremintedOffer(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 handler.createSellerAndPremintedOffer({
                ...createArgs,
                returnTxInfo: true
            });
        }
        else {
            return handler.createSellerAndPremintedOffer({
                ...createArgs,
                returnTxInfo: false
            });
        }
    }
    // Implementation
    async createPremintedOfferWithCondition(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 handler.createPremintedOfferWithCondition({
                ...createArgs,
                returnTxInfo: true
            });
        }
        else {
            return handler.createPremintedOfferWithCondition({
                ...createArgs,
                returnTxInfo: false
            });
        }
    }
    // Implementation
    async createSellerAndPremintedOfferWithCondition(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 handler.createSellerAndPremintedOfferWithCondition({
                ...createArgs,
                returnTxInfo: true
            });
        }
        else {
            return handler.createSellerAndPremintedOfferWithCondition({
                ...createArgs,
                returnTxInfo: false
            });
        }
    }
    // Implementation
    async commitToOfferAndRedeemVoucher(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 handler.commitToOfferAndRedeemVoucher({
                ...commitArgs,
                returnTxInfo: true
            });
        }
        else {
            return handler.commitToOfferAndRedeemVoucher({
                ...commitArgs,
                returnTxInfo: false
            });
        }
    }
    // Implementation
    async commitToConditionalOfferAndRedeemVoucher(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 handler.commitToConditionalOfferAndRedeemVoucher({
                ...commitArgs,
                returnTxInfo: true
            });
        }
        else {
            return handler.commitToConditionalOfferAndRedeemVoucher({
                ...commitArgs,
                returnTxInfo: false
            });
        }
    }
    // Implementation
    async createOfferCommitAndRedeem(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 handler.createOfferCommitAndRedeem({
                ...offerArgs,
                returnTxInfo: true
            });
        }
        else {
            return handler.createOfferCommitAndRedeem({
                ...offerArgs,
                returnTxInfo: false
            });
        }
    }
    // Implementation
    async raiseAndEscalateDispute(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 handler.raiseAndEscalateDispute({
                ...disputeArgs,
                returnTxInfo: true
            });
        }
        else {
            return handler.raiseAndEscalateDispute({
                ...disputeArgs,
                returnTxInfo: false
            });
        }
    }
}
//# sourceMappingURL=mixin.js.map