"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DurationResolver = void 0;
const symbol_sdk_1 = require("symbol-sdk");
const options_resolver_1 = require("../options-resolver");
const integer_validator_1 = require("../validators/integer.validator");
/**
 * Duration resolver
 */
class DurationResolver {
    /**
     * Resolves a duration by the user.
     * @param {Options} options - Command options.
     * @param {string} altText - Alternative text.
     * @param {string} altKey - Alternative key.
     * @returns {Promise<UInt64>}
     */
    async resolve(options, altText, altKey) {
        const resolution = await (0, options_resolver_1.OptionsResolver)(options, altKey ? altKey : 'duration', () => undefined, altText ? altText : 'Enter the duration in number of blocks:', 'text', new integer_validator_1.IntegerStringValidator());
        return symbol_sdk_1.UInt64.fromNumericString(resolution);
    }
}
exports.DurationResolver = DurationResolver;
