"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BlockOrderByResolver = void 0;
const symbol_sdk_1 = require("symbol-sdk");
const options_resolver_1 = require("../options-resolver");
const blockOrderBy_validator_1 = require("../validators/blockOrderBy.validator");
/**
 * Block order by resolver
 */
class BlockOrderByResolver {
    /**
     * Resolves an block order by value provided by the user.
     * @param {Options} options - Command options.
     * @param {string} altText - Alternative text.
     * @param {string} altKey - Alternative key.
     * @returns {Promise<BlockOrderBy>}
     */
    async resolve(options, altText, altKey) {
        const choices = [
            {
                title: 'Height',
                value: symbol_sdk_1.BlockOrderBy.Height,
            },
            {
                title: 'Id',
                value: symbol_sdk_1.BlockOrderBy.Id,
            },
        ];
        const value = await (0, options_resolver_1.OptionsChoiceResolver)(options, altKey ? altKey : 'orderBy', altText ? altText : 'Select a block order by:', choices, 'select', new blockOrderBy_validator_1.BlockOrderByValidator());
        return value;
    }
}
exports.BlockOrderByResolver = BlockOrderByResolver;
