Releases: MetaMask/eth-sig-util
Releases · MetaMask/eth-sig-util
5.0.2
5.0.1
5.0.0 [DEPRECATED]
4.0.1
4.0.0
Added
- BREAKING: Add subpath exports (#214, #211)
- This is breaking because it prevents the import of modules that are not exposed as subpath exports.
- Add
salt
to the EIP-712domain
type (#176) - Add additional unit tests (#146, #164, #167, #169, #172, #177, #180, #170, #171, #178, #173, #182, #184, #185, #187)
- Improve documentation (#157, #177, #174, #180, #178, #181, #186, #212, #207, #213)
Changed
- BREAKING: Consolidate
signTypedData
andrecoverTypedSignature
functions (#156)- The functions
signTypedDataLegacy
,signTypedData
, andsignTypedData_v4
have been replaced with a singlesignTypedData
function with aversion
parameter. Theversion
parameter determines which type of signature you get.- If you used
signTypedDataLegacy
, switch tosignTypedData
with the versionV1
. - If you used
signTypedData
, switch tosignTypedData
with the versionV3
. - If you used
signTypedData_v4
, switch tosignTypedData
with the versionV4
.
- If you used
- The functions
recoverTypedSignatureLegacy
,recoverTypedSignature
, andrecoverTypedSignature_v4
have been replaced with a singlerecoverTypedSignature
function.- If you used
recoverTypedSignatureLegacy
, switch torecoverTypedMessage
with the versionV1
. - If you used
recoverTypedMessage
, switch torecoverTypedMessage
with the versionV3
. - If you used
recoverTypedSignature_v4
, switch torecoverTypedMessage
with the versionV4
.
- If you used
- The functions
- BREAKING: Rename
TypedDataUtils.sign
toTypedDataUtils.eip712Hash
(#104)- This function never actually signed anything. It just created a hash that was later signed. The new name better reflects what the function does.
- BREAKING: Move package under
@metamask
npm organization (#162)- Update your
require
andimport
statements to import@metamask/eth-sig-util
rather thaneth-sig-util
.
- Update your
- BREAKING: Simplify function type signatures (#198)
- This is only a breaking change for TypeScript projects that were importing types used by the function signatures. The types should be far simpler now.
- The
TypedData
has been updated to be more restrictive (it only allows valid typed data now), and it was renamed toTypedDataV1
- BREAKING: Replace
MsgParams
parameters with "options" parameters (#204)- This affects the following functions:
personalSign
recoverPersonalSignature
extractPublicKey
encrypt
encryptSafely
decrypt
decryptSafely
signTypedData
recoverTypedSignature
- All parameters are passed in as a single "options" object now, instead of the
MsgParams
type that was used for most of these functions previously. Read each function signature carefully to ensure you are correctly passing in parameters. personalSign
example:- Previously it was called like this:
personalSign(privateKey, { data })
- Now it is called like this:
personalSign({ privateKey, data })
- Previously it was called like this:
- This affects the following functions:
- BREAKING: Rename
Version
type toSignTypedDataVersion
(#218) - BREAKING: Rename
EIP712TypedData
type toTypedDataV1Field
(#218) - Add
signTypedData
version validation (#201) - Add validation to check that parameters aren't nullish (#205)
- Enable inline sourcemaps (#159)
- Update
ethereumjs-util
to v6 (#138, #195) - Allow
TypedDataUtils
functions to be called unbound (#152) - Update minimum
tweetnacl-util
version (#155) - Add Solidity types to JSON schema for
signTypedData
(#189) - Replace README API docs with generated docs (#213)