"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PayloadResolver = void 0;
const symbol_sdk_1 = require("symbol-sdk");
const options_resolver_1 = require("../options-resolver");
/**
 * Payload resolver
 */
class PayloadResolver {
    /**
     * Resolves an transaction payload provided by the user.
     * @param {Options} options - Command options.
     * @param {string} altText - Alternative text.
     * @param {string} altKey - Alternative key.
     * @returns {Promise<Transaction | InnerTransaction>}
     */
    async resolve(options, altText, altKey) {
        const resolution = await (0, options_resolver_1.OptionsResolver)(options, altKey ? altKey : 'payload', () => undefined, altText ? altText : 'Enter a transaction payload (hex string):', 'text', undefined);
        const transaction = symbol_sdk_1.TransactionMapping.createFromPayload(resolution);
        return transaction;
    }
}
exports.PayloadResolver = PayloadResolver;
