Skip to content

Commit

Permalink
Merge branch 'main' of github.com:amhedcb/nfc-relayer into justinlee/…
Browse files Browse the repository at this point in the history
…fix-submit-contract-call
  • Loading branch information
justin-lee-cb committed Oct 3, 2024
2 parents 03caeb4 + 0199723 commit db377a8
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 @@ -54,15 +54,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 @@ -80,6 +76,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 db377a8

Please sign in to comment.