"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.bosonOrchestrationHandlerIface = void 0;
exports.encodeCreateSellerAndOffer = encodeCreateSellerAndOffer;
exports.encodeCreateOfferWithCondition = encodeCreateOfferWithCondition;
exports.encodeCreateSellerAndOfferWithCondition = encodeCreateSellerAndOfferWithCondition;
exports.encodeCreatePremintedOfferAddToGroup = encodeCreatePremintedOfferAddToGroup;
exports.encodeCreatePremintedOfferWithCondition = encodeCreatePremintedOfferWithCondition;
exports.encodeCreateSellerAndPremintedOffer = encodeCreateSellerAndPremintedOffer;
exports.encodeCreateSellerAndPremintedOfferWithCondition = encodeCreateSellerAndPremintedOfferWithCondition;
exports.encodeRaiseAndEscalateDispute = encodeRaiseAndEscalateDispute;
exports.encodeCommitToOfferAndRedeemVoucher = encodeCommitToOfferAndRedeemVoucher;
exports.encodeCommitToConditionalOfferAndRedeemVoucher = encodeCommitToConditionalOfferAndRedeemVoucher;
exports.encodeCreateOfferCommitAndRedeem = encodeCreateOfferCommitAndRedeem;
const common_1 = require("@bosonprotocol/common");
const abi_1 = require("@ethersproject/abi");
const interface_1 = require("../accounts/interface");
const interface_2 = require("../offers/interface");
const interface_3 = require("../exchanges/interface");
const interface_4 = require("../groups/interface");
exports.bosonOrchestrationHandlerIface = new abi_1.Interface(common_1.abis.IBosonOrchestrationHandlerABI);
function encodeCreateSellerAndOffer(seller, collectionSalt, offer) {
    const sellerArgs = (0, interface_1.createSellerArgsToStruct)(seller, collectionSalt);
    const offerArgs = (0, interface_2.createOfferArgsToStructs)(offer);
    return exports.bosonOrchestrationHandlerIface.encodeFunctionData("createSellerAndOffer", [
        sellerArgs.sellerStruct,
        offerArgs[0], // offer
        offerArgs[1], // offerDates
        offerArgs[2], // offerDurations
        offerArgs[3], // disputeResolverId
        sellerArgs.authTokenStruct,
        sellerArgs.voucherInitValues,
        offerArgs[4], // agentId
        offerArgs[5] // feeLimit
    ]);
}
function encodeCreateOfferWithCondition(offer, condition) {
    const offerArgs = (0, interface_2.createOfferArgsToStructs)(offer);
    return exports.bosonOrchestrationHandlerIface.encodeFunctionData("createOfferWithCondition", [
        offerArgs[0], // offer
        offerArgs[1], // offerDates
        offerArgs[2], // offerDurations
        offerArgs[3], // disputeResolverId
        (0, interface_4.conditionArgsToStructs)(condition),
        offerArgs[4], // agentId
        offerArgs[5] // feeLimit
    ]);
}
function encodeCreateSellerAndOfferWithCondition(seller, collectionSalt, offer, condition) {
    const sellerArgs = (0, interface_1.createSellerArgsToStruct)(seller, collectionSalt);
    const offerArgs = (0, interface_2.createOfferArgsToStructs)(offer);
    return exports.bosonOrchestrationHandlerIface.encodeFunctionData("createSellerAndOfferWithCondition", [
        sellerArgs.sellerStruct,
        offerArgs[0], // offer
        offerArgs[1], // offerDates
        offerArgs[2], // offerDurations
        offerArgs[3], // disputeResolverId
        (0, interface_4.conditionArgsToStructs)(condition),
        sellerArgs.authTokenStruct,
        sellerArgs.voucherInitValues,
        offerArgs[4], // agentId
        offerArgs[5] // feeLimit
    ]);
}
function encodeCreatePremintedOfferAddToGroup(offer, premintParameters, groupId) {
    const offerArgs = (0, interface_2.createOfferArgsToStructs)(offer);
    return exports.bosonOrchestrationHandlerIface.encodeFunctionData("createPremintedOfferAddToGroup", [
        offerArgs[0], // offer
        offerArgs[1], // offerDates
        offerArgs[2], // offerDurations
        offerArgs[3], // disputeResolverId
        premintParameters,
        groupId,
        offerArgs[4], // agentId
        offerArgs[5] // feeLimit
    ]);
}
function encodeCreatePremintedOfferWithCondition(offer, premintParameters, condition) {
    const offerArgs = (0, interface_2.createOfferArgsToStructs)(offer);
    return exports.bosonOrchestrationHandlerIface.encodeFunctionData("createPremintedOfferWithCondition", [
        offerArgs[0], // offer
        offerArgs[1], // offerDates
        offerArgs[2], // offerDurations
        offerArgs[3], // disputeResolverId
        premintParameters,
        (0, interface_4.conditionArgsToStructs)(condition),
        offerArgs[4], // agentId
        offerArgs[5] // feeLimit
    ]);
}
function encodeCreateSellerAndPremintedOffer(seller, collectionSalt, offer, premintParameters) {
    const sellerArgs = (0, interface_1.createSellerArgsToStruct)(seller, collectionSalt);
    const offerArgs = (0, interface_2.createOfferArgsToStructs)(offer);
    return exports.bosonOrchestrationHandlerIface.encodeFunctionData("createSellerAndPremintedOffer", [
        sellerArgs.sellerStruct,
        offerArgs[0], // offer
        offerArgs[1], // offerDates
        offerArgs[2], // offerDurations
        offerArgs[3], // disputeResolverId
        premintParameters,
        sellerArgs.authTokenStruct,
        sellerArgs.voucherInitValues,
        offerArgs[4], // agentId
        offerArgs[5] // feeLimit
    ]);
}
function encodeCreateSellerAndPremintedOfferWithCondition(seller, collectionSalt, offer, premintParameters, condition) {
    const sellerArgs = (0, interface_1.createSellerArgsToStruct)(seller, collectionSalt);
    const offerArgs = (0, interface_2.createOfferArgsToStructs)(offer);
    return exports.bosonOrchestrationHandlerIface.encodeFunctionData("createSellerAndPremintedOfferWithCondition", [
        sellerArgs.sellerStruct,
        offerArgs[0], // offer
        offerArgs[1], // offerDates
        offerArgs[2], // offerDurations
        offerArgs[3], // disputeResolverId
        premintParameters,
        (0, interface_4.conditionArgsToStructs)(condition),
        sellerArgs.authTokenStruct,
        sellerArgs.voucherInitValues,
        offerArgs[4], // agentId
        offerArgs[5] // feeLimit
    ]);
}
function encodeRaiseAndEscalateDispute(exchangeId) {
    return exports.bosonOrchestrationHandlerIface.encodeFunctionData("raiseAndEscalateDispute", [exchangeId]);
}
function encodeCommitToOfferAndRedeemVoucher(offerId) {
    return exports.bosonOrchestrationHandlerIface.encodeFunctionData("commitToOfferAndRedeemVoucher", [offerId]);
}
function encodeCommitToConditionalOfferAndRedeemVoucher(offerId, tokenId) {
    return exports.bosonOrchestrationHandlerIface.encodeFunctionData("commitToConditionalOfferAndRedeemVoucher", [offerId, tokenId]);
}
function encodeCreateOfferCommitAndRedeem(args) {
    return exports.bosonOrchestrationHandlerIface.encodeFunctionData("createOfferCommitAndRedeem", [
        (0, interface_3.fullOfferArgsToStruct)(args),
        args.offerCreator,
        args.signature,
        args.conditionalTokenId || "0"
    ]);
}
//# sourceMappingURL=interface.js.map