Skip to content

Releases: web3/web3.js

v4.1.0-rc.0

09 Aug 15:21
2eacd4b
Compare
Choose a tag to compare
v4.1.0-rc.0 Pre-release
Pre-release

Added

web3

  • Added minimum support of web3.extend function

web3-core

  • Added minimum support of web3.extend function

web3-errors

  • RpcErrorMessages that contains mapping for standard RPC Errors and their messages. (#6230)
  • created TransactionGasMismatchInnerError for clarity on the error in TransactionGasMismatchError (#6215)
  • created MissingGasInnerError for clarity on the error in MissingGasError (#6215)

web3-eth

  • A rpc_method_wrapper (signTypedData) for the rpc calls eth_signTypedData and eth_signTypedData_v4 (#6286)
  • A signTypedData method to the Web3Eth class (#6286)

web3-eth-abi

  • A getEncodedEip712Data method that takes an EIP-712 typed data object and returns the encoded data with the option to also keccak256 hash it (#6286)

web3-rpc-methods

  • A signTypedData method to eth_rpc_methods for the rpc calls eth_signTypedData and eth_signTypedData_v4 (#6286)

web3-types

  • eth_signTypedData and eth_signTypedData_v4 to web3_eth_execution_api (#6286)
  • Eip712TypeDetails and Eip712TypedData to eth_types (#6286)

web3-validator

  • Added json-schema as a main json schema type (#6264)

Fixed

web3-core

  • Fixed the issue: "Version 4.x does not fire connected event for subscriptions. #6252". (#6262)

web3-errors

  • Fixed: "'disconnect' in Eip1193 provider must emit ProviderRpcError #6003".(#6230)

web3-eth

  • sendTransaction will have gas filled by default using method estimateGas unless transaction builder options.fillGas is false. (#6249)
  • Missing blockHeaderSchema properties causing some properties to not appear in response of newHeads subscription (#6243)
  • Missing blockHeaderSchema properties causing some properties to not appear in response of newHeads subscription (#6243)

web3-providers-ws

  • Ensure a fixed version for "@types/ws": "8.5.3" (#6309)

Changed

web3-core

  • No need to pass CommonSubscriptionEvents & at every child class of Web3Subscription (#6262)
  • Implementation of _processSubscriptionResult and _processSubscriptionError has been written in the base class Web3Subscription and maid public. (#6262)
  • A new optional protected method formatSubscriptionResult could be used to customize data formatting instead of re-implementing _processSubscriptionResult. (#6262)
  • No more needed to pass CommonSubscriptionEvents & for the first generic parameter of Web3Subscription when inheriting from it. (#6262)

web3-eth

  • MissingGasError error message changed for clarity (#6215)
  • input and data are no longer auto populated for transaction objects if they are not present. Instead, whichever property is provided by the user is formatted and sent to the RPC provider. Transaction objects returned from RPC responses are still formatted to contain both input and data properties (#6294)

web3-eth-accounts

  • Dependencies updated

web3-eth-contract

  • Dependencies updated

web3-eth-ens

  • Dependencies updated

web3-eth-iban

  • Dependencies updated

web3-eth-personal

  • Dependencies updated

web3-net

  • Dependencies updated

web3-providers-http

  • Dependencies updated

web3-providers-ipc

  • Dependencies updated

web3-types

  • input and data are now optional properties on PopulatedUnsignedBaseTransaction (previously input was a required property, and data was not available) (#6294)

web3-utils

  • Dependencies updated

web3-validator

  • Replace is-my-json-valid with zod dependency. Related code was changed (#6264)
  • Types ValidationError and JsonSchema were changed (#6264)

Removed

web3-eth

  • Missing blockHeaderSchema properties causing some properties to not appear in response of newHeads subscription (#6243)
  • Type RawValidationError was removed (#6264)

web3-validator

  • Type RawValidationError was removed (#6264)

v1.10.1-rc.0

08 Aug 11:19
b8b9d74
Compare
Choose a tag to compare
v1.10.1-rc.0 Pre-release
Pre-release

Fixed

  • Builds fixed by updating all typescript versions to 4.9.5 (#6238)
  • ABI encoding for large negative ints (#6239)
  • Updated type file for submitWork parameters, accepts 3 parameters instead of an array (#5200)

Changed

  • Replace ethereumjs-util with @ethereumjs/util (#6283)

v4.0.3

11 Jul 14:48
bce9a8b
Compare
Choose a tag to compare

Fixed

web3

  • Fixed bug #6236 by adding personal type in web3.eth (#6245)

web3-rpc-methods

web3-types

  • type Filter includes blockHash (#6206)

web3-utils

  • BigInts pass validation within the method numberToHex (#6206)

Changed

web3-core

  • Dependencies updated

web3-errors

  • Dependencies updated

web3-eth

  • Dependencies updated

web3-eth-abi

  • Dependencies updated

web3-eth-accounts

  • Dependencies updated

web3-eth-contract

  • Dependencies updated

web3-eth-ens

  • Dependencies updated

web3-eth-iban

  • Dependencies updated

web3-eth-personal

  • Dependencies updated

web3-net

  • Dependencies updated

web3-providers-http

  • Dependencies updated

web3-providers-ipc

  • Dependencies updated

web3-providers-ws

  • Dependencies updated

web3-validator

  • Dependencies updated

v4.0.2

27 Jun 12:03
47583e7
Compare
Choose a tag to compare

Fixed

web3

  • Fixed bug #6185, now web3.js compiles on typescript v5 (#6195)
  • Fixed #6162 @types/ws issue (#6205)

web3-core

  • Fixed Batch requests erroring out on one request (#6164)
  • Fixed the issue: Subscribing to multiple blockchain events causes every listener to be fired for every registered event (#6210)
  • Fixed the issue: Unsubscribe at a Web3Subscription class will still have the id of the subscription at the Web3SubscriptionManager (#6210)
  • Fixed the issue: A call to the provider is made for every subscription object (#6210)

web3-eth-abi

  • Support for "decoding" indexed string event arguments (returns the keccak256 hash of the string value instead of the actual string value) (#6167)

web3-eth-accounts

  • Fixed "The r and s returned by signTransaction to does not always consist of 64 characters #6207" (#6216)

web3-eth-contract

  • Event filtering using non-indexed and indexed string event arguments (#6167)

web3-eth-ens

  • Fixed bug #6185, now web3.js compiles on typescript v5 (#6195)

web3-providers-ws

web3-types

  • Fixed bug #6185, now web3.js compiles on typescript v5 (#6195)

Added

web3

  • Exported Web3Context, Web3PluginBase, Web3EthPluginBase from 'web3-core', and Web3Validator from 'web3-validator' (#6165)

web3-core

  • Web3Subscription constructor accept a Subscription Manager (as an alternative to accepting Request Manager that is now marked marked as deprecated) (#6210)

web3-types

  • Added the SimpleProvider interface which has only request(args) method that is compatible with EIP-1193 (#6210)
  • Added the Eip1193EventName type that contains the possible events names according to EIP-1193 (#6210)

Changed

web3-core

  • Web3Subscription constructor overloading that accept a Request Manager is marked as deprecated (#6210)

web3-errors

  • Dependencies updated

web3-eth

  • Dependencies updated

web3-eth-iban

  • Dependencies updated

web3-eth-personal

  • Dependencies updated

web3-net

  • Dependencies updated

web3-providers-http

  • Dependencies updated

web3-providers-ipc

  • Dependencies updated

web3-rpc-methods

  • Dependencies updated

web3-types

  • The EIP1193Provider class has now all the events (for on and removeListener) according to EIP-1193 (#6210)

web3-utils

  • Dependencies updated

web3-validator

  • Dependencies updated

v4.0.1

07 Jun 14:10
5b5bf87
Compare
Choose a tag to compare

Web3.js 4.0.1 is written in TypeScript and has many exciting features such as:

  • Easy extensibility ( with web3 Plugins feature. example: Chainlink Plugin )
  • In compliance with ETH EL Specification
  • Dynamic Contract Typing
  • Native typescript
  • ESM CJS native builds
  • 85%+ test coverage
  • Custom data formatting feature
  • Reduced package size
  • New packages ( web3-types, web3-errors, web3-validator, web3-rpc-methods )
  • Validation functionality using schema

Documentation:

Detailed List of changes are mentioned under:

If there are any bugs, improvements, optimizations or any new feature proposal feel free to create github issue, or post a pull request for contributions.

v4.0.1-rc.2

05 Jun 12:37
e0c1aac
Compare
Choose a tag to compare
v4.0.1-rc.2 Pre-release
Pre-release

Added

web3-errors

  • InvalidPropertiesForTransactionTypeError with error code 429 (#6102)

web3-eth-contract

  • Added support for getPastEvents method to filter allEvents and specific event (#6010)
  • Added maxPriorityFeePerGas and maxFeePerGas in ContractOptions type and updated function using it in utils (#6118)
  • Added method's type autodetection by ABI param (#6137)

web3-types

  • Added filters param to the Filter type (#6010)
  • Added types JsonRpcSubscriptionResultOld, Web3ProviderMessageEventCallback. Added .on('data') type support for old providers (#6082)
  • Export for HardforksOrdered enum (#6102)
  • Export for Web3ValidationErrorObject type (#6102)

web3-utils

  • Optional hexstrict parameter added to numberToHex (#6004)

Fixed

web3-eth

  • Fixed ignoreGasPricing bug with wallet in context (#6071)

web3-eth-accounts

  • Fixed ESM import bugs reported in (#6032) and (#6034)
  • ESM projects will not need to run --experimental-specifier-resolution=node (#6127)

Changed

web3-core

  • Replaced Buffer for Uint8Array (#6004)

web3-errors

  • Nested Smart Contract error data is extracted at Eip838ExecutionError constructor and the nested error is set at innerError (#6045)

web3-eth

  • formatTransaction no longer throws a TransactionDataAndInputError if it's passed a transaction object with both data and input properties set (as long as they are the same value) (#6064)
  • Refactored documentation for rpc_method_wrappers to point to the previously duplicated documentation found under the Web3Eth class documentation (#6054)
  • Replaced Buffer for Uint8Array (#6004)
  • Refactored defaultTransactionTypeParser to return correct EIP-2718 types, prior implementation was prioritizing transaction.hardfork and ignoring the use of transaction.gasLimit. defaultTransactionTypeParser will now throw InvalidPropertiesForTransactionTypeErrors for properties are used that are incompatible with transaction.type (#6102)
  • prepareTransactionForSigning and defaultTransactionBuilder now accepts optional fillGasPrice flag and by default will not fill gas(#6071)

web3-eth-abi

  • Nested Smart Contract error data hex string is decoded when the error contains the data as object (when the data hex string is inside data.originalError.data or data.data) (#6045)

web3-eth-accounts

  • Replaced Buffer for Uint8Array (#6004)
  • The methods recover, encrypt, privateKeyToAddress does not support type Buffer but supports type Uint8Array (#6004)
  • The method parseAndValidatePrivateKey returns a type Uint8Array instead of type Buffer (#6004)

web3-providers-ipc

  • Replaced Buffer for Uint8Array (#6004)

web3-types

  • Removed chainId, to, data & input properties from NonPayableCallOptions
  • Replaced Buffer for Uint8Array (#6004)
  • types FMT_BYTES.BUFFER, Bytes and FormatType and encryption option types for salt and iv has replaced support for Buffer for Uint8Array (#6004)
  • Added internalType property to the AbiParameter type.

web3-utils

  • Replaced Buffer for Uint8Array (#6004)
  • The methods hexToBytes, randomBytes does not return type Buffer but type Uint8Array (#6004)
  • The methods sha3 and keccak256Wrapper does not accept type Buffer but type Uint8Array (#6004)
  • The method bytesToBuffer has been removed for the usage of bytesToUint8Array (#6004)

web3-validator

  • Replaced Buffer for Uint8Array (#6004)

Removed

web3-eth-ens

  • Removed non read-only methods (#6084)

web3-validator

  • Web3ValidationErrorObject type is now exported from web3-types package (#6102)

v1.10.0

10 May 15:18
f3846d1
Compare
Choose a tag to compare

Fixed

  • Improved the error propagation in web3-providers-http package to effectively propagate useful error infomation about failed HTTP connections (#5955)
  • Fixed "Uncaught TypeError" calling a contract function that revert using MetaMask (#4454) and related "n.data.substring is not a function", that is raised when there is a revert and web.eth.handleRevert = true (#6000)

Changed

  • transaction.type is now formatted to a hex string before being send to provider (#5979)
  • When sending a transaction, if transaction.type === '0x1' && transaction.accessList === undefined, then transaction.accessList is set to [] (#5979)
  • Removed an unnecessary chainId parameter from toChecksumAddress() function types (#5888)

Added

  • Added support for getPastEvents method to filter allEvents and specific event (#6015)

Security

  • Updated dependencies (#6044)

v1.10.0-rc.0

02 May 14:49
3ed053f
Compare
Choose a tag to compare
v1.10.0-rc.0 Pre-release
Pre-release

Fixed

  • Improved the error propagation in web3-providers-http package to effectively propagate useful error infomation about failed HTTP connections (#5955)
  • Fixed "Uncaught TypeError" calling a contract function that revert using MetaMask (#4454) and related "n.data.substring is not a function", that is raised when there is a revert and web.eth.handleRevert = true (#6000)

Changed

  • transaction.type is now formatted to a hex string before being send to provider (#5979)
  • When sending a transaction, if transaction.type === '0x1' && transaction.accessList === undefined, then transaction.accessList is set to [] (#5979)
  • Removed an unnecessary chainId parameter from toChecksumAddress() function types (#5888)

Added

  • Added support for getPastEvents method to filter allEvents and specific event (#6015)

Security

  • Updated dependencies (#6044)

v4.0.1-rc.1

20 Apr 11:23
a984e14
Compare
Choose a tag to compare
v4.0.1-rc.1 Pre-release
Pre-release

Changed

web3

  • No need for polyfilling nodejs net and fs modules (#5978)
  • Removed IPC provider dependency, IPC path is no longer viable provider. If you wanna use IPC, please install web3-providers-ipc and instantiate provider yourself (#5978)

web3-core

  • If a transaction object with a data property is passed to txInputOptionsFormatter, it will now be replaced with input (#5915)
  • The types TransactionTypeParser and TransactionBuilder are now utilizing the type Transaction for the transaction object. (#5993)
  • No need for polyfilling nodejs net and fs modules (#5978)
  • Removed IPC provider dependency, IPC path is no longer viable provider. If you wanna use IPC, please install web3-providers-ipc and instantiate provider yourself (#5978)

web3-errors

  • gasLimit is no longer accepted as a parameter for MissingGasError and `TransactionGasMismatchError, and is also no longer included in error message (#5915)

web3-eth

  • signTransaction will now return gas instead of gasLimit for returned transaction object regardless of what property name the provider uses (#5915)
  • formatTransaction will now replace data transaction property with input (#5915)
  • isTransactionCall will now check if value.input isHexStrict if provided (#5915)
  • The functions defaultTransactionBuilder and transactionBuilder are now utilizing the type Transaction for the transaction object. (#5993)

web3-eth-accounts

  • Moved @ethereumjs/tx, @ethereumjs/common code to our source code (#5963)
  • The method signTransaction returned by privateKeyToAccount is now accepting the type Transaction for its argument. (#5993)

web3-eth-contract

  • getSendTxParams will now return input instead of data in returned transaction parameters object (#5915)
  • Contract constructor will now thrown new ContractTransactionDataAndInputError if both data and input are passed in ContractInitOptions for Contract constructor (#5915)
  • The types ContractInitOptions, NonPayableCallOptions and PayableCallOptions are moved to web3-types. (#5993)

web3-types

  • data property in TransactionOutput was renamed to input (#5915)
  • The method signTransaction inside Web3BaseWalletAccount is now utilizing the type Transaction for its argument. (#5993)
  • The types FMT_NUMBER, NumberTypes, FMT_BYTES, ByteTypes, DataFormat, DEFAULT_RETURN_FORMAT, ETH_DATA_FORMAT and FormatType moved from web3-utils. (#5993)
  • The types ContractInitOptions, NonPayableCallOptions and PayableCallOptions are moved from web3-eth-contract. (#5993)

web3-utils

  • The types FMT_NUMBER, NumberTypes, FMT_BYTES, ByteTypes, DataFormat, DEFAULT_RETURN_FORMAT, ETH_DATA_FORMAT and FormatType moved to web3-types. (#5993)

Added

web3

  • Added source files (#5956)
  • Added hybrid build (ESM and CJS) of library (#5904)

web3-core

  • Added hybrid build (ESM and CJS) of library (#5904)
  • Added source files (#5956)

web3-errors

  • Added hybrid build (ESM and CJS) of library (#5904)
  • Added source files (#5956)

web3-eth

  • Added source files (#5956)

web3-eth-abi

  • Added hybrid build (ESM and CJS) of library (#5904)
  • Added source files (#5956)

web3-eth-accounts

  • Added source files (#5956)
  • Added hybrid build (ESM and CJS) of library (#5904)

web3-eth-contract

  • input is now an acceptable property for ContractInitOptions in place of data (either can be used, but input is used withing the Contract class) (#5915)
  • Added source files (#5956)
  • Added hybrid build (ESM and CJS) of library (#5904)

web3-eth-ens

  • Added source files (#5956)
  • Added hybrid build (ESM and CJS) of library (#5904)

web3-eth-iban

  • Added source files (#5956)
  • Added hybrid build (ESM and CJS) of library (#5904)

web3-eth-personal

  • Added source files (#5956)
  • Added hybrid build (ESM and CJS) of library (#5904)

web3-net

  • Added source files (#5956)
  • Added hybrid build (ESM and CJS) of library (#5904)

web3-providers-http

  • Added source files (#5956)
  • Added hybrid build (ESM and CJS) of library (#5904)

web3-providers-ipc

  • Added source files (#5956)
  • Added hybrid build (ESM and CJS) of library (#5904)

web3-providers-ws

  • Added source files (#5956)
  • Added hybrid build (ESM and CJS) of library (#5904)

web3-rpc-methods

  • Added source files (#5956)
  • Added hybrid build (ESM and CJS) of library (#5904)

web3-types

  • Added hybrid build (ESM and CJS) of library (#5904)
  • Added source files (#5956)

web3-utils

  • Added source files (#5956)
  • Added hybrid build (ESM and CJS) of library (#5904)

web3-validator

  • Added source files (#5956)
  • Added hybrid build (ESM and CJS) of library (#5904)
  • Added functions isHexString, isHexPrefixed, validateNoLeadingZeroes (#5963)

Removed

web3-core

  • getConfig method from Web3Config class, config is now public and accessible using Web3Config.config (#5950)

web3-eth

  • Removed dependencies @ethereumjs/tx, @ethereumjs/common (#5963)

web3-eth-abi

  • Removed formatDecodedObject function (#5934)

web3-eth-contract

  • data was removed as a property of ContractOptions type (#5915)

web3-utils

  • Removed dependencies @ethereumjs/tx, @ethereumjs/common (#5963)

Fixed

web3-eth-ens

  • Bug fix of checkNetwork in ENS (#5988)

v1.9.0

20 Mar 16:31
db5f505
Compare
Choose a tag to compare

Fixed

  • Fixed skipped ws-ganache tests (#5759)
  • Fixed "provider started to reconnect error" in web3-provider-ws (#5820)
  • Fixed Error: Number can only safely store up to 53 bits (#5845)
  • Fixed types for packages which have default exports but not declared default export in .d.ts (#5866)
  • Fixed Transaction type by adding missing properties (#5856)

Changed

  • Add optional hexFormat param to getTransaction and getBlock that accepts the value 'hex' (#5845)
  • utils.toNumber and utils.hexToNumber can now return the large unsafe numbers as BigInt, if true was passed to a new optional parameter called bigIntOnOverflow (#5845)
  • Updated @types/bn.js dependency to 5.1.1 in web3, web3-core and web3-eth-contract as reason mentioned in #5640 (#5885)
  • Add description to error for failed connection on websocket (#5884)

Security

  • Updated dependencies (#5885)