From 9dff047df63afb0d988831fa935f24400ee2bac9 Mon Sep 17 00:00:00 2001 From: Justin Lee Date: Wed, 2 Oct 2024 10:14:40 -0500 Subject: [PATCH] append the tx hash to the uuid --- src/pages/api/submitPaymentTx/index.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/pages/api/submitPaymentTx/index.ts b/src/pages/api/submitPaymentTx/index.ts index 2db1d9b..6d39f3d 100644 --- a/src/pages/api/submitPaymentTx/index.ts +++ b/src/pages/api/submitPaymentTx/index.ts @@ -50,15 +50,11 @@ export default async function handler( ); const txParams = [from, to, value, validAfter, validBefore, nonce, v, r, s]; - console.log(txParams); - // estimate gas const estimatedGasLimit = await contract.estimateGas.transferWithAuthorization.apply(null, txParams); // generate unsigned tx - - const tx = await contract.populateTransaction.transferWithAuthorization.apply( null, txParams @@ -76,6 +72,9 @@ export default async function handler( try { const txSubmission = await provider.sendTransaction(signedTx); + const txHash = txSubmission.hash; + await appendTxHashToPayment(uuid, txHash); + res.status(200).json({ data: txSubmission }); } catch (err: any) { // TODO: Report error somehwere