Mixtral_ether / async_function.py
jeduardogruiz's picture
Create async_function.py
d0f4cb4 verified
raw
history blame
843 Bytes
npx hardhat compile ; npx hardhat run scripts/deploy.js --network localhost
async function main() {
const { ethers } = require("hardhat");
const recipientAddress = "0xRecipientAddress"; // Replace with the recipient's Ethereum address
const amountToSend = ethers.utils.parseEther("0.1"); // 0.1 ETH
const provider = ethers.provider;
const signer = await ethers.getSigner();
const transaction = {
to: recipientAddress,
value: amountToSend,
gasLimit: 21000,
gasPrice: ethers.utils.parseUnits("10", "gwei"),
};
const tx = await signer.sendTransaction(transaction);
console.log("Transaction hash:", tx.hash);
const receipt = await tx.wait();
console.log("Transaction receipt:", receipt);
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});