Skip to content

Commit

Permalink
Create transactionHandler.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Nov 20, 2024
1 parent 03ddc1d commit f3f9e4f
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import web3 from './web3';

export const createTransaction = async (to, value, from) => {
const transaction = {
to,
value: web3.utils.toWei(value.toString(), 'ether'),
gas: 2000000,
from
};
return await web3.eth.sendTransaction(transaction);
};

export const getTransactionReceipt = async (txHash) => {
return await web3.eth.getTransactionReceipt(txHash);
};

0 comments on commit f3f9e4f

Please sign in to comment.