"use strict";
// SPDX-License-Identifier: Apache-2.0
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClearingTransfer = exports.ClearingRedeem = exports.ClearingHoldCreation = exports.CastClearingOperationType = exports.ClearingOperationType = exports.ClearingOperationIdentifier = exports.ProtectedClearingOperation = exports.ClearingOperationFrom = exports.ClearingOperation = void 0;
const InvalidClearingOperationType_1 = require("./error/values/InvalidClearingOperationType");
class ClearingOperation {
    partition;
    expirationTimestamp;
    data;
}
exports.ClearingOperation = ClearingOperation;
class ClearingOperationFrom {
    clearingOperation;
    from;
    operatorData;
}
exports.ClearingOperationFrom = ClearingOperationFrom;
class ProtectedClearingOperation {
    clearingOperation;
    from;
    deadline;
    nonce;
}
exports.ProtectedClearingOperation = ProtectedClearingOperation;
class ClearingOperationIdentifier {
    partition;
    tokenHolder;
    clearingOperationType;
    clearingId;
}
exports.ClearingOperationIdentifier = ClearingOperationIdentifier;
var ClearingOperationType;
(function (ClearingOperationType) {
    ClearingOperationType[ClearingOperationType["Transfer"] = 0] = "Transfer";
    ClearingOperationType[ClearingOperationType["Redeem"] = 1] = "Redeem";
    ClearingOperationType[ClearingOperationType["HoldCreation"] = 2] = "HoldCreation";
})(ClearingOperationType || (exports.ClearingOperationType = ClearingOperationType = {}));
class CastClearingOperationType {
    static fromBigint(id) {
        switch (id) {
            case 0n:
                return ClearingOperationType.Transfer;
            case 1n:
                return ClearingOperationType.Redeem;
            case 2n:
                return ClearingOperationType.HoldCreation;
            default:
                throw new InvalidClearingOperationType_1.InvalidClearingOperationTypeNumber(Number(id));
        }
    }
    static toNumber(value) {
        switch (value) {
            case ClearingOperationType.Transfer:
                return 0;
            case ClearingOperationType.Redeem:
                return 1;
            case ClearingOperationType.HoldCreation:
                return 2;
            default:
                throw new InvalidClearingOperationType_1.InvalidClearingOperationType(value);
        }
    }
}
exports.CastClearingOperationType = CastClearingOperationType;
class ClearingHoldCreation {
    amount;
    expirationTimestamp;
    data;
    operatorData;
    holdEscrowId;
    holdExpirationTimestamp;
    holdTo;
    holdData;
    constructor(amount, expirationTimestamp, data, operatorData, holdEscrowId, holdExpirationTimestamp, holdTo, holdData) {
        this.amount = amount;
        this.expirationTimestamp = expirationTimestamp;
        this.data = data;
        this.operatorData = operatorData;
        this.holdEscrowId = holdEscrowId;
        this.holdExpirationTimestamp = holdExpirationTimestamp;
        this.holdTo = holdTo;
        this.holdData = holdData;
    }
}
exports.ClearingHoldCreation = ClearingHoldCreation;
class ClearingRedeem {
    amount;
    expirationTimestamp;
    data;
    operatorData;
    constructor(amount, expirationTimestamp, data, operatorData) {
        this.amount = amount;
        this.expirationTimestamp = expirationTimestamp;
        this.data = data;
        this.operatorData = operatorData;
    }
}
exports.ClearingRedeem = ClearingRedeem;
class ClearingTransfer {
    amount;
    expirationTimestamp;
    destination;
    data;
    operatorData;
    constructor(amount, expirationTimestamp, destination, data, operatorData) {
        this.expirationTimestamp = expirationTimestamp;
        this.amount = amount;
        this.destination = destination;
        this.data = data;
        this.operatorData = operatorData;
    }
}
exports.ClearingTransfer = ClearingTransfer;
