// SPDX-License-Identifier: Apache-2.0
import { InvalidClearingOperationType, InvalidClearingOperationTypeNumber, } from "./error/values/InvalidClearingOperationType";
export class ClearingOperation {
    partition;
    expirationTimestamp;
    data;
}
export class ClearingOperationFrom {
    clearingOperation;
    from;
    operatorData;
}
export class ProtectedClearingOperation {
    clearingOperation;
    from;
    deadline;
    nonce;
}
export class ClearingOperationIdentifier {
    partition;
    tokenHolder;
    clearingOperationType;
    clearingId;
}
export var ClearingOperationType;
(function (ClearingOperationType) {
    ClearingOperationType[ClearingOperationType["Transfer"] = 0] = "Transfer";
    ClearingOperationType[ClearingOperationType["Redeem"] = 1] = "Redeem";
    ClearingOperationType[ClearingOperationType["HoldCreation"] = 2] = "HoldCreation";
})(ClearingOperationType || (ClearingOperationType = {}));
export 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 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(value);
        }
    }
}
export 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;
    }
}
export class ClearingRedeem {
    amount;
    expirationTimestamp;
    data;
    operatorData;
    constructor(amount, expirationTimestamp, data, operatorData) {
        this.amount = amount;
        this.expirationTimestamp = expirationTimestamp;
        this.data = data;
        this.operatorData = operatorData;
    }
}
export 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;
    }
}
