fixed pixTarget treated as pixTimestamp

This commit is contained in:
hueso
2025-07-04 21:09:32 -03:00
parent dd351acb2e
commit 23163be99d
5 changed files with 15 additions and 22 deletions

View File

@@ -69,24 +69,20 @@ export const withdrawDeposit = async (
export const releaseLock = async (
lockID: bigint,
pixtarget: string,
signature: string
pixTimestamp: `0x${string}`&{lenght:34},
signature: `0x${string}`
): Promise<any> => {
const { address, abi, wallet, client, account } = await getContract();
console.log("Releasing lock", { lockID, pixtarget, signature });
if (!wallet) {
throw new Error("Wallet not connected");
}
// Convert pixtarget to bytes32
const pixTimestamp = keccak256(stringToHex(pixtarget, { size: 32 }) );
const { request } = await client.simulateContract({
address,
abi,
functionName: "release",
args: [BigInt(lockID), pixTimestamp, stringToHex(signature)],
args: [BigInt(lockID), pixTimestamp, signature],
account
});