"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PasswordResolver = void 0;
const symbol_sdk_1 = require("symbol-sdk");
const options_resolver_1 = require("../options-resolver");
const password_validator_1 = require("../validators/password.validator");
/**
 * Password resolver
 */
class PasswordResolver {
    /**
     * Resolves a password provided by the user.
     * @param {Options} options - Command options.
     * @param {string} altText - Alternative text.
     * @param {string} altKey - Alternative key.
     * @returns {Promise<Password>}
     */
    async resolve(options, altText, altKey) {
        const resolution = await (0, options_resolver_1.OptionsResolver)(options, altKey ? altKey : 'password', () => undefined, altText ? altText : 'Enter your wallet password:', 'password', new password_validator_1.PasswordValidator());
        return new symbol_sdk_1.Password(resolution);
    }
}
exports.PasswordResolver = PasswordResolver;
