// SPDX-License-Identifier: Apache-2.0
import { LockFacet__factory } from "@hashgraph/asset-tokenization-contracts";
import { _PARTITION_ID_1, GAS } from "../../../../core/Constants";
import LogService from "../../../../app/service/log/LogService";
export class LockOperations {
    executor;
    constructor(executor) {
        this.executor = executor;
    }
    async lock(security, sourceId, amount, expirationDate, securityId) {
        LogService.logTrace(`Locking ${amount} tokens from account ${sourceId.toString()} until ${expirationDate}`);
        return this.executor.executeContractCall(securityId.toString(), LockFacet__factory.createInterface(), "lockByPartition", [_PARTITION_ID_1, amount.toHexString(), sourceId.toString(), expirationDate.toHexString()], GAS.LOCK);
    }
    async release(security, sourceId, lockId, securityId) {
        LogService.logTrace(`Releasing lock ${lockId} from account ${sourceId.toString()}`);
        return this.executor.executeContractCall(securityId.toString(), LockFacet__factory.createInterface(), "releaseByPartition", [_PARTITION_ID_1, lockId.toHexString(), sourceId.toString()], GAS.RELEASE);
    }
}
