"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const contractWrapperBase_1 = require("../contractWrapperBase");
const contractWrapperFactory_1 = require("../contractWrapperFactory");
class TokenCapGCWrapper extends contractWrapperBase_1.ContractWrapperBase {
    constructor() {
        super(...arguments);
        this.name = "TokenCapGC";
        this.frendlyName = "Token Cap Global Constraint";
        this.factory = exports.TokenCapGCFactory;
    }
    setParameters(params) {
        const _super = name => super[name];
        return __awaiter(this, void 0, void 0, function* () {
            if (!params.token) {
                throw new Error("token must be set");
            }
            if (((typeof params.cap !== "number") &&
                ((typeof params.cap !== "string") ||
                    (isNaN(parseInt(params.cap, undefined)))))) {
                throw new Error("cap must be set and represent a number");
            }
            return _super("setParameters").call(this, params.token, params.cap);
        });
    }
}
exports.TokenCapGCWrapper = TokenCapGCWrapper;
exports.TokenCapGCFactory = new contractWrapperFactory_1.default("TokenCapGC", TokenCapGCWrapper);
//# sourceMappingURL=tokenCapGC.js.map