Skip to content

v1.5.0-rc.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@spacesailor24 spacesailor24 released this 21 Jul 20:52
· 181 commits to 1.x since this release

Added

  • London transaction support (#4155)

An example of signing an EIP-1559 transaction with web3-eth-accounts

import Web3 from 'web3';

const web3 = new Web3(Web3.givenProvider || 'http://localhost:8545');

const txObject = {
    to: '0x...',
    value: web3.utils.toHex(web3.utils.toWei('0.1', 'ether')),
    gas: web3.utils.toHex(21000),
    maxFeePerGas: web3.utils.toHex(web3.utils.toWei('1.5', 'gwei')),
    maxPriorityFeePerGas: web3.utils.toHex(web3.utils.toWei('.5', 'gwei'))
 };

 web3.eth.accounts.signTransaction(txObject, privateKey, (err, signed) => {...});