Skip to content

Instantly share code, notes, and snippets.

@hellwolf
Created October 9, 2021 18:28
Show Gist options
  • Save hellwolf/759eb27c2b1d4959a1b13fed5c474e22 to your computer and use it in GitHub Desktop.
Save hellwolf/759eb27c2b1d4959a1b13fed5c474e22 to your computer and use it in GitHub Desktop.
send-1559tx.js
(async function() {
const provider = new ethers.providers.JsonRpcProvider(PROVIDER_URL);
let wallet = new ethers.Wallet(PRIVATE_KEY);
wallet = wallet.connect(provider);
const tx = await wallet.sendTransaction({
to: "0x07B02d301DE53eb9D1A6B7485Ac2065c53071645",
value: 1e15,
// maxPriorityFeePerGas + baseFeePerGas < maxFeePerGas
maxPriorityFeePerGas: 100e9,
maxFeePerGas: 200e9,
nonce: 25,
});
console.log("tx", tx);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment