github web3/web3.js v1.5.0-rc.0

latest releases: v4.8.0, v4.7.0, v4.6.0...
pre-release2 years ago

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) => {...});

Don't miss a new web3.js release

NewReleases is sending notifications on new releases.