"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RestrictionAccountOperationFlagValidator = exports.RestrictionAccountMosaicFlagValidator = exports.RestrictionAccountAddressFlagValidator = exports.RestrictionMosaicTypeValidator = void 0;
const symbol_sdk_1 = require("symbol-sdk");
/**
 * Validator of mosaic restriction type
 */
class RestrictionMosaicTypeValidator {
    /**
     * Validates if a mosaic restriction type is valid.
     * @param {number} value - Mosaic restriction type.
     * @returns {true | string}
     */
    validate(value) {
        const keys = Object.keys(symbol_sdk_1.MosaicRestrictionType).filter((key) => Number.isNaN(parseFloat(key)));
        return keys.includes(value) ? true : 'MosaicRestrictionType must be one of (' + keys + ').';
    }
}
exports.RestrictionMosaicTypeValidator = RestrictionMosaicTypeValidator;
/**
 * Validator of account restriction address flag
 */
class RestrictionAccountAddressFlagValidator {
    /**
     * Validates if an account restriction address flag is valid.
     * @param {number} value - account address restriction flag.
     * @returns {true | string}
     */
    validate(value) {
        const keys = Object.keys(symbol_sdk_1.AddressRestrictionFlag).filter((key) => Number.isNaN(parseFloat(key)));
        return keys.includes(value) ? true : 'AddressRestrictionFlag must be one of (' + keys + ').';
    }
}
exports.RestrictionAccountAddressFlagValidator = RestrictionAccountAddressFlagValidator;
/**
 * Validator of account restriction mosaic flag
 */
class RestrictionAccountMosaicFlagValidator {
    /**
     * Validates if an account restriction mosaic flag is valid.
     * @param {number} value - account mosaic restriction flag.
     * @returns {true | string}
     */
    validate(value) {
        const keys = Object.keys(symbol_sdk_1.MosaicRestrictionFlag).filter((key) => Number.isNaN(parseFloat(key)));
        return keys.includes(value) ? true : 'MosaicRestrictionFlag must be one of (' + keys + ').';
    }
}
exports.RestrictionAccountMosaicFlagValidator = RestrictionAccountMosaicFlagValidator;
/**
 * Validator of account restriction operation flag
 */
class RestrictionAccountOperationFlagValidator {
    /**
     * Validates if an account restriction operation flag is valid.
     * @param {number} value - account operation restriction flag.
     * @returns {true | string}
     */
    validate(value) {
        const keys = Object.keys(symbol_sdk_1.OperationRestrictionFlag).filter((key) => Number.isNaN(parseFloat(key)));
        return keys.includes(value) ? true : 'OperationRestrictionFlag must be one of (' + keys + ')';
    }
}
exports.RestrictionAccountOperationFlagValidator = RestrictionAccountOperationFlagValidator;
