"use strict";
// SPDX-License-Identifier: Apache-2.0
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const SecurityDate_1 = require("../../../../../../domain/context/shared/SecurityDate");
const ValidatedArgs_1 = __importDefault(require("../../../../../../core/validation/ValidatedArgs"));
const FormatValidation_1 = __importDefault(require("../../../../../in/request/FormatValidation"));
class ProtectedTransferFromByPartitionRequest extends ValidatedArgs_1.default {
    securityId;
    partitionId;
    sourceId;
    targetId;
    amount;
    deadline;
    nounce;
    signature;
    constructor({ securityId, partitionId, sourceId, targetId, amount, deadline, nounce, signature, }) {
        super({
            securityId: FormatValidation_1.default.checkHederaIdFormatOrEvmAddress(),
            partitionId: FormatValidation_1.default.checkBytes32Format(),
            sourceId: FormatValidation_1.default.checkHederaIdFormatOrEvmAddress(),
            targetId: FormatValidation_1.default.checkHederaIdFormatOrEvmAddress(),
            amount: FormatValidation_1.default.checkAmount(),
            deadline: (val) => {
                return SecurityDate_1.SecurityDate.checkDateTimestamp(parseInt(val), Math.ceil(new Date().getTime() / 1000), undefined);
            },
        });
        this.securityId = securityId;
        this.sourceId = sourceId;
        this.targetId = targetId;
        this.amount = amount;
        this.partitionId = partitionId;
        this.deadline = deadline;
        this.nounce = nounce;
        this.signature = signature;
    }
}
exports.default = ProtectedTransferFromByPartitionRequest;
