"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.KeyResolver = void 0;
const symbol_sdk_1 = require("symbol-sdk");
const options_resolver_1 = require("../options-resolver");
const key_validator_1 = require("../validators/key.validator");
class KeyResolver {
    /**
     * Resolves a string key provided by 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 : 'key', () => undefined, altText
            ? altText
            : 'Enter a UInt64 key in hexadecimal format.' +
                " You can use the command 'symbol-cli converter stringToKey' " +
                'to turn a string into a valid key:', 'text', new key_validator_1.KeyValidator());
        return symbol_sdk_1.UInt64.fromHex(resolution);
    }
}
exports.KeyResolver = KeyResolver;
