From 0463cec489f61cae315c1835de791a9d98d5c20e Mon Sep 17 00:00:00 2001 From: Jan-Felix Date: Thu, 2 May 2024 12:30:42 +0200 Subject: [PATCH] cowordersigner: don't hardcode validDuration to support limit orders --- extension/src/transactionTranslations/cowswapSetPreSignature.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension/src/transactionTranslations/cowswapSetPreSignature.ts b/extension/src/transactionTranslations/cowswapSetPreSignature.ts index 0c4ab192..2f3c0a1e 100644 --- a/extension/src/transactionTranslations/cowswapSetPreSignature.ts +++ b/extension/src/transactionTranslations/cowswapSetPreSignature.ts @@ -68,7 +68,7 @@ export default { (response) => response.json() ) - const validDuration = 60 * 30 // 30 minutes + const validDuration = order.validTo - Math.floor(Date.now() / 1000) const feeAmountBP = Math.ceil( (parseInt(order.feeAmount) / parseInt(order.sellAmount)) * 10000 )