github ChainSafe/web3.js v1.5.0

latest releases: v1.7.2-rc.0, v1.7.1, v1.7.1-rc.0...
3 years ago

Added

  • London transaction support (#4155)
  • RPC support eth_feehistory call (#4191)

Changed

  • Grammar fix (#4088) and updated Swarm (#4151)and Whisper doc links (#4170)
  • Removed deprecation notice for HttpProvider (#4008)
  • Nonce added to send options in documentation and types (#4052)
  • Updated Solidity example to modern syntax (#4147)
  • Changing web3 connection example from lets to const (#3967)
  • Updated the documentation for the transaction object to include EIP-2718 and EIP-1559 options (#4188)

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.