Skip to content

Commit

Permalink
append the tx hash to the uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-lee-cb committed Oct 2, 2024
1 parent 7f4f1bd commit 9dff047
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/pages/api/submitPaymentTx/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 9dff047

Please sign in to comment.