"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const darc_1 = require("../../darc");
/**
 * Arrange arguments for a Darc contract, ie. provide a meaningful
 * representation of its arguments.
 */
class DarcBeautifier {
    static Spawn(args) {
        const res = Array();
        args.forEach((arg) => {
            switch (arg.name) {
                case "darc":
                    const darc = darc_1.Darc.decode(arg.value);
                    res.push({ name: "darc", value: darc.description.toString(), full: darc.toString() });
                    break;
                default:
                    res.push({ name: arg.name, value: "unspecified", full: arg.value.toString("hex") });
                    break;
            }
        });
        return res;
    }
    static Invoke(args) {
        const res = Array();
        args.forEach((arg) => {
            switch (arg.name) {
                case "darc":
                    const darc = darc_1.Darc.decode(arg.value);
                    res.push({ name: "darc", value: darc.description.toString(), full: darc.toString() });
                    break;
                default:
                    res.push({ name: arg.name, value: "unspecified", full: arg.value.toString("hex") });
                    break;
            }
        });
        return res;
    }
}
exports.DarcBeautifier = DarcBeautifier;
