"use strict";
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PolymeshTransaction = void 0;
const internal_1 = require("../internal");
const internal_2 = require("../utils/internal");
/**
 * Wrapper class for a Polymesh Transaction
 */
class PolymeshTransaction extends internal_1.PolymeshTransactionBase {
    /**
     * @hidden
     */
    constructor(transactionSpec, context) {
        const { args, batchSize } = transactionSpec, rest = __rest(transactionSpec, ["args", "batchSize"]);
        super(rest, context);
        this.inputArgs = args;
        this.batchSize = batchSize;
    }
    /**
     * Arguments for the transaction
     */
    get args() {
        if (!this.unwrappedArgs) {
            this.unwrappedArgs = internal_2.unwrapValues(this.inputArgs);
        }
        return this.unwrappedArgs;
    }
    /**
     * @hidden
     */
    composeTx() {
        const { tx, args } = this;
        return tx(...args);
    }
}
exports.PolymeshTransaction = PolymeshTransaction;
//# sourceMappingURL=PolymeshTransaction.js.map