"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.bosonGroupHandlerIface = void 0;
exports.encodeCreateGroup = encodeCreateGroup;
exports.createGroupArgsToStructs = createGroupArgsToStructs;
exports.conditionArgsToStructs = conditionArgsToStructs;
const common_1 = require("@bosonprotocol/common");
const abi_1 = require("@ethersproject/abi");
exports.bosonGroupHandlerIface = new abi_1.Interface(common_1.abis.IBosonGroupHandlerABI);
function encodeCreateGroup(args) {
    return exports.bosonGroupHandlerIface.encodeFunctionData("createGroup", createGroupArgsToStructs(args));
}
function createGroupArgsToStructs(args) {
    return [
        {
            id: "0",
            sellerId: args.sellerId,
            offerIds: args.offerIds
        },
        conditionArgsToStructs(args)
    ];
}
function conditionArgsToStructs(args) {
    return {
        method: args.method,
        tokenType: args.tokenType,
        tokenAddress: args.tokenAddress,
        gating: args.gatingType,
        minTokenId: args.minTokenId,
        maxTokenId: args.maxTokenId,
        threshold: args.threshold,
        maxCommits: args.maxCommits
    };
}
//# sourceMappingURL=interface.js.map