"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.methodEncoder = function (abiCoder, abiItemModel, deployData) {
    var encodedParameters = abiCoder.encodeParameters(abiItemModel.getInputs(), abiItemModel.contractMethodParameters);
    if (encodedParameters.startsWith('0x')) {
        encodedParameters = encodedParameters.slice(2);
    }
    if (abiItemModel.isOfType('constructor')) {
        if (!deployData) {
            throw new Error('The contract has no contract data option set. This is necessary to append the constructor parameters.');
        }
        return deployData + encodedParameters;
    }
    if (abiItemModel.isOfType('function')) {
        return abiItemModel.signature + encodedParameters;
    }
    return encodedParameters;
};
//# sourceMappingURL=encoder.js.map