diff --git a/packages/checkout/widgets-lib/src/widgets/sale/hooks/useSignOrder.ts b/packages/checkout/widgets-lib/src/widgets/sale/hooks/useSignOrder.ts index 9f4962dd8c..8388bb0146 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/hooks/useSignOrder.ts +++ b/packages/checkout/widgets-lib/src/widgets/sale/hooks/useSignOrder.ts @@ -228,35 +228,9 @@ export const useSignOrder = (input: SignOrderInput) => { [provider], ); - const expirePrevSignedOrder = useCallback(async () => { - const reference = signResponse?.transactions - .find((txn) => txn.methodCall.startsWith('execute'))?.params.reference; - - if (!reference) return; - - try { - const baseUrl = `${PRIMARY_SALES_API_BASE_URL[env]}/${environmentId}/order/expire`; - const response = await fetch(baseUrl, { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ reference }), - }); - - if (!response.ok) { - const { code, message } = (await response.json()) as SignApiError; - throw new Error(code, { cause: message }); - } - } catch (e) { - // eslint-disable-next-line no-console - console.warn(`Failed to expire transaction with ref: '${reference}'`, e); - } - }, [signResponse, env, environmentId]); - const sign = useCallback( async (paymentType: PaymentTypes): Promise => { try { - await expirePrevSignedOrder(); - const data: SignApiRequest = { recipient_address: recipientAddress, payment_type: paymentType, @@ -291,7 +265,7 @@ export const useSignOrder = (input: SignOrderInput) => { } return undefined; }, - [items, fromContractAddress, recipientAddress, environmentId, env, provider, expirePrevSignedOrder], + [items, fromContractAddress, recipientAddress, environmentId, env, provider], ); const execute = async (