Skip to content

Releases: MetaMask/utils

3.4.1

06 Jan 12:35
c29ba04
Compare
Choose a tag to compare

Fixed

  • Bump superstruct to ^1.0.3 (#71)

3.4.0

05 Jan 10:59
ef4a890
Compare
Choose a tag to compare

Added

  • Add types and utility functions for validating versions and checksums (#67, #69)

Fixed

  • JSON-RPC types now have a default generic Params value (#54)

3.3.1

07 Nov 14:22
4002fec
Compare
Choose a tag to compare

Fixed

  • JSON-RPC parameters are now properly cast to Json upon validation (#51)

3.3.0

02 Nov 11:08
5cdc1e9
Compare
Choose a tag to compare

Added

  • Add more assertion utils (#49)
  • Add JSON-RPC error validation functions (#46)
  • Add convenience function for creating a DataView (#45)

Fixed

  • Update JSON validation logic (#47)
    • Validation would previously allow for undefined values, which is not a standard JSON type

3.2.0

07 Oct 08:54
e35fa7d
Compare
Choose a tag to compare

Added

  • Add PendingJsonRpcResponse type (#43)
  • Add utils for converting between numbers and hex (#41)
  • Add coercion utils (#38)

3.1.0

03 Oct 09:17
970227e
Compare
Choose a tag to compare

Added

  • Add assertion utils (#33)
  • Add util functions for encoding and decoding bytes (#34)

Fixed

  • Make JSON-RPC error data property optional (#31)
  • Don't include test files in dist folder (#35)
  • Fix typo in README (#28)

3.0.3

26 Sep 13:09
65100c5
Compare
Choose a tag to compare

Fixed

  • Allow omitting JSON-RPC params when params can be undefined (#29)

3.0.2

23 Sep 16:14
4597dd9
Compare
Choose a tag to compare

Fixed

  • Bump superstruct to ^0.16.5 (#26)
    • superstructs 0.16.1 through 0.16.4 were not compatible with Node 14; this restores that compatibility.

3.0.1

19 Aug 23:15
3abe4ff
Compare
Choose a tag to compare

Fixed

  • Promote @types/debug from development dependencies to production dependencies (#23)

3.0.0

19 Aug 19:01
df2fa2e
Compare
Choose a tag to compare

Added

  • Add logging functions (#20)
  • Add frozen collections (implemented in #5 but exported in #19)

Changed

  • BREAKING: Improve types and type validation (#19)
    • Various type changes have been made that might be breaking:
      • The JsonRpcRequest and JsonRpcNotification types now include a generic constraint requiring that the Params type extends the JsonRpcParams type.
      • The JsonRpcSuccess and JsonRpcResponse types now include a generic contraint for the Result type, requiring that it extends the Json type.
      • Various validation functions now accept unknown parameters rather than specific types. This should not be breaking except that it may affect type inference for the parameters passed in.
    • New JSON-related functions have been added:
      • assertIsJsonRpcResponse
      • isJsonRpcResponse
      • InferWithParams
      • JsonRpcParams
    • New JSON Struct types have been added:
      • JsonRpcErrorStruct
      • JsonRpcFailureStruct
      • JsonRpcIdStruct
      • JsonRpcParamsStruct
      • JsonRpcRequestStruct
      • JsonRpcResponseStruct
      • JsonRpcSuccessStruct
      • JsonRpcVersionStruct
      • JsonStruct